diff --git a/Formula/drone-cli.rb b/Formula/drone-cli.rb new file mode 100644 index 0000000000..db5ea542cc --- /dev/null +++ b/Formula/drone-cli.rb @@ -0,0 +1,29 @@ +class DroneCli < Formula + desc "Drone CLI" + homepage "https://drone.io" + url "https://github.com/drone/drone-cli.git", + :tag => "v1.1.1", + :revision => "b796291a8a07a0300696ee3944418236751788e1" + + depends_on "dep" => :build + depends_on "go" => :build + + def install + ENV["GOPATH"] = buildpath + + dir = buildpath/"src/github.com/drone/drone-cli" + dir.install buildpath.children + + cd dir do + system "dep", "ensure", "-vendor-only" + system "go", "build", "-ldflags", "-X main.version=#{version}", "-o", bin/"drone", "drone/main.go" + prefix.install_metafiles + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/drone --version") + + assert_match /manage logs/, shell_output("#{bin}/drone log 2>&1") + end +end