diff options
Diffstat (limited to 'kubent.rb')
-rw-r--r-- | kubent.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kubent.rb b/kubent.rb new file mode 100644 index 0000000..201c973 --- /dev/null +++ b/kubent.rb @@ -0,0 +1,23 @@ +class Kubent < Formula + desc "Easily check your clusters for use of deprecated APIs" + homepage "https://github.com/doitintl/kube-no-trouble" + url "https://github.com/doitintl/kube-no-trouble/archive/refs/tags/0.7.0.tar.gz" + sha256 "a0517831170b48648aba3fcabfd553350dc75764597a5d7c02bad6253ddeaa90" + license "MIT" + head "https://github.com/doitintl/kube-no-trouble.git", branch: "master" + + depends_on "go" => [:build] + + def install + ldflags = "-s -w" + + if build.head? + ldflags += " -X main.version=#{Utils.git_head}" + ldflags += " -X main.gitSha=#{Utils.git_head}" + else + ldflags += " -X main.version=v#{version}" + end + + system "go", "build", "-ldflags", ldflags, "-o", bin/"kubent", "./cmd/kubent" + end +end |