chart-testing 3.0.0 (new formula)
Closes #58615. Signed-off-by: Dawid Dziurla <dawidd0811@gmail.com>master
parent
1e50fb5212
commit
b966b71b6b
|
@ -0,0 +1,33 @@
|
|||
class ChartTesting < Formula
|
||||
desc "Testing and linting Helm charts"
|
||||
homepage "https://github.com/helm/chart-testing"
|
||||
url "https://github.com/helm/chart-testing.git",
|
||||
tag: "v3.0.0",
|
||||
revision: "50db473a1e68c605b18d82f019d83ea401542213"
|
||||
license "Apache-2.0"
|
||||
|
||||
depends_on "go" => :build
|
||||
depends_on "helm" => :test
|
||||
depends_on "yamllint" => :test
|
||||
|
||||
def install
|
||||
commit = Utils.safe_popen_read("git", "rev-parse", "HEAD").chomp
|
||||
ldflags = %W[
|
||||
-X github.com/helm/chart-testing/v3/ct/cmd.Version=#{version}
|
||||
-X github.com/helm/chart-testing/v3/ct/cmd.GitCommit=#{commit}
|
||||
-X github.com/helm/chart-testing/v3/ct/cmd.BuildDate=#{Date.today}
|
||||
].join(" ")
|
||||
system "go", "build", *std_go_args, "-ldflags", ldflags, "-o", bin/"ct", "./ct/main.go"
|
||||
etc.install "etc" => "ct"
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "Lint and test", shell_output("#{bin}/ct --help")
|
||||
|
||||
# Lint an empty Helm chart that we create with `helm create`
|
||||
system "helm", "create", "testchart"
|
||||
output = shell_output("#{bin}/ct lint --charts ./testchart --validate-chart-schema=false" \
|
||||
" --validate-maintainers=false").lines.last.chomp
|
||||
assert_match "All charts linted successfully", output
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue