homebrew-core/Formula/vault.rb
2019-04-15 23:32:23 +02:00

44 lines
1.4 KiB
Ruby

# 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.1.1",
:revision => "a3dcd63451cf6da1d04928b601bbe9748d53842e"
head "https://github.com/hashicorp/vault.git"
bottle do
cellar :any_skip_relocation
sha256 "6438095a389197b98fff966c931769672d1973b896539489ccf7771aee8ca8f3" => :mojave
sha256 "e54ce9780eb108ac1c61e3e9baecbebc146b9b013b94a3eb3bcaf07a3f13bfbd" => :high_sierra
sha256 "72bfa7a7fac04a3c2c28a12ae4b008f045b458b27b36905c2627df4da7a41a3f" => :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