aboutsummaryrefslogtreecommitdiff
path: root/kubent.rb
blob: 201c9733d43538bbce59b196f1a93866fb7a99cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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