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/v2.3.2.tar.gz" sha256 "760557880353beca3cc9aef3183507ff31696ad65d4b3341eaa52c30393146ab" head "https://github.com/segmentio/chamber.git" bottle do cellar :any_skip_relocation sha256 "1f0d20b4517f5f288e6dd5bd712dbaa8627cadf5e3f192c2c4e82532fb2f0683" => :mojave sha256 "cdbe6be1a7f516cff12be94469e3007bba0f709fc8a28621a8406b32327e9a34" => :high_sierra sha256 "8f40df94bce52835b9e7b65a59de8417125793b632b440bfb645dbe189e1483c" => :sierra 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 "src/github.com/segmentio/chamber" do system "govendor", "sync" system "go", "build", "-o", bin/"chamber", "-ldflags", "-X main.Version=#{version}" 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