# Please don't update this formula until the release is official via # mailing list or blog post. There's a history of GitHub tags moving around. # https://github.com/hashicorp/vault/issues/1051 class Vault < Formula desc "Secures, stores, and tightly controls access to secrets" homepage "https://vaultproject.io/" url "https://github.com/hashicorp/vault.git", :tag => "v1.2.1", :revision => "e16495da552c996068e05574cddf69875199f949" head "https://github.com/hashicorp/vault.git" bottle do cellar :any_skip_relocation sha256 "4afd77a02f34fbfc3f910d99bbb09521a317cfa572374999d78fb31c46eb0c71" => :mojave sha256 "76e67595f8cc777402e132f9bbdcd527b822a6a8882bca117a5c82b25e899799" => :high_sierra sha256 "e7c7b000e8a9bfe545f4ed609c5a674d6450375e1bff53b823135e5b31d942c4" => :sierra end depends_on "go" => :build depends_on "gox" => :build def install ENV["GOPATH"] = buildpath contents = buildpath.children - [buildpath/".brew_home"] (buildpath/"src/github.com/hashicorp/vault").install contents (buildpath/"bin").mkpath cd "src/github.com/hashicorp/vault" do system "make", "dev" bin.install "bin/vault" prefix.install_metafiles end end test do pid = fork { exec bin/"vault", "server", "-dev" } sleep 1 ENV.append "VAULT_ADDR", "http://127.0.0.1:8200" system bin/"vault", "status" Process.kill("TERM", pid) end end