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.5.tar.gz" sha256 "be252801b89cd88a651833d1f4770e50ef1c46283190096dda71a902c35085aa" head "https://github.com/segmentio/chamber.git" bottle do cellar :any_skip_relocation sha256 "335df38f4c238f4a5d2a16fecb69939ed6713ed8dd8d973982ca24f39360c472" => :catalina sha256 "5dd2e5805853221f8cbe79083c7fdf13d85f16c70885d8cc78bacef7e641ee82" => :mojave sha256 "5dd41982896b1d61207d658897e415e7bd9cbadf6c81c6362d592d9c50006bf7" => :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