homebrew-core/Formula/eksctl.rb

43 lines
1.4 KiB
Ruby

class Eksctl < Formula
desc "Simple command-line tool for creating clusters on Amazon EKS"
homepage "https://eksctl.io"
url "https://github.com/weaveworks/eksctl.git",
tag: "0.32.0",
revision: "41d40c256b68823f42a8c71cce7a2eb4d6236ce7"
license "Apache-2.0"
head "https://github.com/weaveworks/eksctl.git"
bottle do
cellar :any_skip_relocation
sha256 "7a8ab91ea8a6e3925c0fa6c3faa9f3eb742600a3b7710ab2da2d7a2915abf859" => :big_sur
sha256 "d9d82c69ba12a5a4a814bcf6c5c0689e22da71d3dc13c03495d92a0d50824819" => :catalina
sha256 "0262d856dd6219204730bd3fa3bac93866e6f0cefd7e0c9b5ab637424d5a42f7" => :mojave
end
depends_on "go" => :build
depends_on "go-bindata" => :build
depends_on "aws-iam-authenticator"
def install
ENV["GOBIN"] = HOMEBREW_PREFIX/"bin"
system "make", "build"
bin.install "eksctl"
# Install bash completion
output = Utils.safe_popen_read("#{bin}/eksctl", "completion", "bash")
(bash_completion/"eksctl").write output
# Install zsh completion
output = Utils.safe_popen_read("#{bin}/eksctl", "completion", "zsh")
(zsh_completion/"_eksctl").write output
end
test do
assert_match "The official CLI for Amazon EKS",
shell_output("#{bin}/eksctl --help")
assert_match "Error: couldn't create node group filter from command line options: --cluster must be set",
shell_output("#{bin}/eksctl create nodegroup 2>&1", 1)
end
end