diff --git a/Formula/k/kaniko.rb b/Formula/k/kaniko.rb new file mode 100644 index 0000000000..fa602bc62a --- /dev/null +++ b/Formula/k/kaniko.rb @@ -0,0 +1,23 @@ +class Kaniko < Formula + desc "Build Container Images In Kubernetes" + homepage "https://github.com/chainguard-dev/kaniko" + url "https://github.com/chainguard-dev/kaniko/archive/refs/tags/v1.25.13.tar.gz" + sha256 "d64be2d35c885f45d3c50b71b47e5534eaa2cb46178835abcb0d9f214c71ef7e" + license "Apache-2.0" + head "https://github.com/chainguard-dev/kaniko.git", branch: "main" + + depends_on "go" => :build + depends_on :linux + + def install + ldflags = "-s -w -X github.com/chainguard-dev/kaniko/pkg/version.Version=#{version}" + + %w[executor warmer].each do |cmd| + system "go", "build", *std_go_args(ldflags:, output: bin/"kaniko-#{cmd}"), "./cmd/#{cmd}" + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/kaniko-executor --version") + end +end