homebrew-core/Formula/chamber.rb
2018-02-26 23:45:28 -08:00

43 lines
1.4 KiB
Ruby

class Chamber < Formula
desc "CLI for managing secrets through AWS SSM Parameter Store"
homepage "https://github.com/segmentio/chamber"
url "https://github.com/segmentio/chamber/archive/v1.16.0.tar.gz"
sha256 "286e7e132edb0fac666c098e22c1fad7933f934550caa683a0d49b0d79de1e2b"
head "https://github.com/segmentio/chamber.git"
bottle do
cellar :any_skip_relocation
sha256 "5236be927464e8c1ec68cec2e8fa01d4f6aa35bc872e6bcb3f97f9aa1749727a" => :high_sierra
sha256 "2b903826f4d05f60715f27064cfa56db9813f2faf221aef61f95c3f2d37624a8" => :sierra
sha256 "cff15e178da648bf39af2ade130d5d66bed7ec3629c034d701626eeaa6181d3d" => :el_capitan
end
depends_on "go" => :build
depends_on "govendor" => :build
def install
ENV["GOPATH"] = buildpath
ENV["GOOS"] = "darwin"
ENV["GOARCH"] = "amd64"
ENV["CGO_ENABLED"] = "0"
path = buildpath/"src/github.com/segmentio/chamber"
path.install Dir["{*,.git}"]
cd buildpath/"src/github.com/segmentio/chamber" do
system "govendor", "sync"
system "go", "build", "-o", bin/"chamber"
prefix.install_metafiles
end
end
test do
ENV.delete "AWS_REGION"
output = shell_output("#{bin}/chamber list service 2>&1", 1)
assert_match "MissingRegion", output
ENV["AWS_REGION"] = "us-west-2"
output = shell_output("#{bin}/chamber list service 2>&1", 1)
assert_match "NoCredentialProviders", output
end
end