homebrew-core/Formula/vault.rb
2018-04-10 20:47:13 +02:00

47 lines
1.5 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 => "v0.10.0",
:revision => "5dd7f25f5c4b541f2da62d70075b6f82771a650d"
head "https://github.com/hashicorp/vault.git"
bottle do
cellar :any_skip_relocation
sha256 "4ff1b5e8eb778ffc3ec619a5eec1a0de8ebbd8ad9fd7bd5dc5995b63a86d7ad3" => :high_sierra
sha256 "26806f016116d3e7b398c3a9103e7959d9f5e0df91f798c3f42f280806133b73" => :sierra
sha256 "6f1fb1b31efd2c5be1398ca564618dc9c3aa8ae37b58033014f12215c5a640d6" => :el_capitan
end
option "with-dynamic", "Build dynamic binary with CGO_ENABLED=1"
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
target = build.with?("dynamic") ? "dev-dynamic" : "dev"
system "make", target
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