homebrew-core/Formula/argo.rb

42 lines
1.5 KiB
Ruby

class Argo < Formula
desc "Get stuff done with container-native workflows for Kubernetes"
homepage "https://argoproj.io"
url "https://github.com/argoproj/argo.git",
tag: "v3.0.0",
revision: "46628c88cf7de2f1e0bcd5939a91e4ce1592e236"
license "Apache-2.0"
bottle do
sha256 cellar: :any_skip_relocation, big_sur: "8f84055a1b8d9e67c2532b16e1cead764a412e8b0be58bd56a5683bd9c8b3c76"
sha256 cellar: :any_skip_relocation, catalina: "5ed8bbc59001993ef4e042b7a1232f4d94788d0fea92f61a91e05e10d271d298"
sha256 cellar: :any_skip_relocation, mojave: "8223ffca7d230f00c7872adc0acf22a64e07656595afa5d89bc2e185dd3b6db1"
end
depends_on "go" => :build
depends_on "node@14" => :build
depends_on "yarn" => :build
def install
# this needs to be remove to prevent multiple 'operation not permitted' errors
inreplace "Makefile", "CGO_ENABLED=0", ""
system "make", "dist/argo"
bin.install "dist/argo"
output = Utils.safe_popen_read("#{bin}/argo", "completion", "bash")
(bash_completion/"argo").write output
output = Utils.safe_popen_read("#{bin}/argo", "completion", "zsh")
(zsh_completion/"_argo").write output
end
test do
assert_match "argo:",
shell_output("#{bin}/argo version")
# argo consumes the Kubernetes configuration with the `--kubeconfig` flag
# Since it is an empty file we expect it to be invalid
touch testpath/"kubeconfig"
assert_match "invalid configuration",
shell_output("#{bin}/argo lint --kubeconfig ./kubeconfig ./kubeconfig 2>&1", 1)
end
end