81 lines
2.5 KiB
Ruby
81 lines
2.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: "v1.5.5",
|
|
revision: "f5d1ddb3750e7c28e25036e1ef26a4c02379fc01"
|
|
license "MPL-2.0"
|
|
head "https://github.com/hashicorp/vault.git"
|
|
|
|
livecheck do
|
|
url "https://releases.hashicorp.com/vault/"
|
|
regex(%r{href=.*?v?(\d+(?:\.\d+)+)/?["' >]}i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "90aab2af3b4af97ccbf3b27afa752bb51296027ee4895d34fc90bf639d46a68b" => :catalina
|
|
sha256 "dafa1b61268993a3469518b49c50e0876426642aa985a2a4eb955e3012b7cd9e" => :mojave
|
|
sha256 "a63c8c926d76cb3fb4d404eae5ea7f84551eb95a3aa9eb2e2130b02716732dfb" => :high_sierra
|
|
end
|
|
|
|
depends_on "go" => :build
|
|
depends_on "gox" => :build
|
|
depends_on "node@10" => :build
|
|
depends_on "yarn" => :build
|
|
|
|
def install
|
|
ENV.prepend_path "PATH", "#{ENV["GOPATH"]}/bin"
|
|
system "make", "bootstrap", "static-dist", "dev-ui"
|
|
bin.install "bin/vault"
|
|
end
|
|
|
|
plist_options manual: "vault server -dev"
|
|
|
|
def plist
|
|
<<~EOS
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>KeepAlive</key>
|
|
<dict>
|
|
<key>SuccessfulExit</key>
|
|
<false/>
|
|
</dict>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/vault</string>
|
|
<string>server</string>
|
|
<string>-dev</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{var}</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/vault.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/vault.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
port = free_port
|
|
ENV["VAULT_DEV_LISTEN_ADDRESS"] = "127.0.0.1:#{port}"
|
|
ENV["VAULT_ADDR"] = "http://127.0.0.1:#{port}"
|
|
|
|
pid = fork { exec bin/"vault", "server", "-dev" }
|
|
sleep 1
|
|
system bin/"vault", "status"
|
|
Process.kill("TERM", pid)
|
|
end
|
|
end
|