velero: fix version injection

Closes #39609.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Christoph Blecker 2019-05-08 19:12:39 -07:00 committed by FX Coudert
parent 192890a81e
commit 92999076b1

View file

@ -3,7 +3,7 @@ class Velero < Formula
homepage "https://github.com/heptio/velero"
url "https://github.com/heptio/velero/archive/v0.11.0.tar.gz"
sha256 "366f4c1ed5800dbdddefa60ed88bdd82b406b69b76a214b1d7108997a2f973ac"
revision 1
revision 2
bottle do
cellar :any_skip_relocation
@ -22,7 +22,7 @@ class Velero < Formula
cd dir do
system "go", "build", "-o", bin/"velero", "-installsuffix", "static",
"-ldflags",
"-X github.com/heptio/velero/pkg/buildinfo.Version=#{version}",
"-X github.com/heptio/velero/pkg/buildinfo.Version=v#{version}",
"./cmd/velero"
# Install bash completion
@ -40,7 +40,7 @@ class Velero < Formula
test do
output = shell_output("#{bin}/velero 2>&1")
assert_match "Velero is a tool for managing disaster recovery", output
assert_match "Version: #{version}", shell_output("#{bin}/velero version --client-only 2>&1")
assert_match "Version: v#{version}", shell_output("#{bin}/velero version --client-only 2>&1")
system bin/"velero", "client", "config", "set", "TEST=value"
assert_match "value", shell_output("#{bin}/velero client config get 2>&1")
end