homebrew-core/Formula/drone-cli.rb

30 lines
773 B
Ruby
Raw Normal View History

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