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