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.3.tar.gz" sha256 "0ae67252b6f6c9d000e24d780066427895761576acf314b0559e9a6c10ce43ba" head "https://github.com/segmentio/chamber.git" bottle do cellar :any_skip_relocation sha256 "da720a76073dc7cf2cc2982fc1309a1c6fb6102f4d6bcaecdbebc34cc1115747" => :mojave sha256 "53c669dcb153a71882511900748ea47334e9235291fe6c9f5fa428afb2fbfb16" => :high_sierra sha256 "3b16347748b75763ef405c5692504dfb62f1057dd447f47ac366ff7375b020cb" => :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