From 42b721a2b17e0a2f41a117b2e85116efe9ff6b83 Mon Sep 17 00:00:00 2001 From: Aaron Hurt Date: Wed, 5 Oct 2016 20:52:45 -0500 Subject: [PATCH] consul-backinator 1.2 (new formula) New fomrula consul-backinator Adding consul-backinator a Consul (consul.io) backup and restoration utility. Closes #5620. Signed-off-by: Mike McQuaid --- Formula/consul-backinator.rb | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Formula/consul-backinator.rb diff --git a/Formula/consul-backinator.rb b/Formula/consul-backinator.rb new file mode 100644 index 0000000000..bd760320d5 --- /dev/null +++ b/Formula/consul-backinator.rb @@ -0,0 +1,31 @@ +class ConsulBackinator < Formula + desc "Consul backup and restoration application" + homepage "https://github.com/myENA/consul-backinator" + url "https://github.com/myENA/consul-backinator/archive/v1.2.tar.gz" + sha256 "f3fa711053d91c06b2a20393a62192e03642f72e9b31c9ce16953ce76f3c4a54" + head "https://github.com/myENA/consul-backinator.git" + + depends_on "go" => :build + depends_on "glide" => :build + + def install + ENV["GOPATH"] = buildpath + ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}" + + dir = buildpath/"src/github.com/myENA/consul-backinator" + dir.install buildpath.children + + cd dir do + system "glide", "install", "-v" + system "go", "build", "-v", "-ldflags", + "-X main.appVersion=#{version}", "-o", + bin/"consul-backinator" + prefix.install_metafiles + end + end + + test do + output = shell_output("#{bin}/consul-backinator --version 2>&1", 1) + assert_equal version.to_s, output.strip + end +end