2017-10-25 21:03:57 +00:00
|
|
|
class Chamber < Formula
|
|
|
|
desc "CLI for managing secrets through AWS SSM Parameter Store"
|
|
|
|
homepage "https://github.com/segmentio/chamber"
|
2018-05-09 00:28:35 +00:00
|
|
|
url "https://github.com/segmentio/chamber/archive/v2.1.0.tar.gz"
|
|
|
|
sha256 "d28bf9d02f9477bf3339e750287d32ecbeaa2d1398411624074a4d4498e9693a"
|
2017-10-25 21:03:57 +00:00
|
|
|
head "https://github.com/segmentio/chamber.git"
|
|
|
|
|
2017-12-02 01:41:25 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any_skip_relocation
|
2018-05-09 00:33:21 +00:00
|
|
|
sha256 "1eaa1dd2acde6d889557b0f713c7ec9655cb8715f5526f50bfe7c63b9ce63d3c" => :high_sierra
|
|
|
|
sha256 "413cbf130fbd5bef2c69f74eb9ec2bf077ce1aa90a935d825cc55e0c88b983c3" => :sierra
|
|
|
|
sha256 "a44294004e2aaf3bd9514edf0ba7bddeff1e10b198722c9d69cff7f0244cd9c5" => :el_capitan
|
2017-12-02 01:41:25 +00:00
|
|
|
end
|
|
|
|
|
2017-10-25 21:03:57 +00:00
|
|
|
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"
|
2018-03-26 16:28:23 +00:00
|
|
|
system "go", "build", "-o", bin/"chamber",
|
|
|
|
"-ldflags", "-X main.Version=#{version}"
|
2017-10-25 21:03:57 +00:00
|
|
|
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
|