From b3a5b70dfea88e4ae8c8403f717cf75071e1e3ac Mon Sep 17 00:00:00 2001 From: Orien Madgwick <_@orien.io> Date: Sat, 17 Jun 2017 02:26:29 +1000 Subject: [PATCH] iamy 2.0.0 (new formula) Closes #14665. Signed-off-by: ilovezfs --- Formula/iamy.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Formula/iamy.rb diff --git a/Formula/iamy.rb b/Formula/iamy.rb new file mode 100644 index 00000000000..08c2899d14a --- /dev/null +++ b/Formula/iamy.rb @@ -0,0 +1,30 @@ +class Iamy < Formula + desc "AWS IAM import and export tool" + homepage "https://github.com/99designs/iamy" + url "https://github.com/99designs/iamy/archive/v2.0.0.tar.gz" + sha256 "44906985ac2a7a0f4a703c4eb872e626770ffa1ea01a589279e75867a4348630" + head "https://github.com/99designs/iamy.git" + + depends_on "glide" => :build + depends_on "go" => :build + depends_on "awscli" + + def install + ENV["GOPATH"] = buildpath + ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}" + dir = buildpath/"src/github.com/99designs/iamy" + dir.install buildpath.children + cd dir do + system "glide", "install" + system "go", "build", "-o", bin/"iamy", "-ldflags", + "-X main.Version=v#{version}" + end + end + + test do + ENV.delete "AWS_ACCESS_KEY" + ENV.delete "AWS_SECRET_KEY" + output = shell_output("#{bin}/iamy pull 2>&1", 1) + assert_match "Can't determine the AWS account", output + end +end