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.7.2.tar.gz" sha256 "eb2255b45f3f951be9cd504294ff5ff122bd3e277e95ada5c578ee50dffb9ca1" head "https://github.com/segmentio/chamber.git" bottle do cellar :any_skip_relocation sha256 "719cf1ff8a30bbb72e9d704d7e4e2f42cdd1c9c9b749c12460ab9dd522ef508c" => :catalina sha256 "cd4a8685e1c1015625abae3db9d928d1b3b57473d97e24e1c927cac87bd573d4" => :mojave sha256 "129584f05584be7a304edd108dfd520bb98e96e70e48ee457f11a7ed49e2700e" => :high_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