Add ArtifactHUB pre-release annotations to the Helm chart

Signed-off-by: Richard Wall <richard.wall@jetstack.io>
This commit is contained in:
Richard Wall 2021-05-27 13:32:56 +01:00
parent a80198c03d
commit 1f3c3df090
2 changed files with 24 additions and 0 deletions

View File

@ -38,6 +38,28 @@ genrule(
visibility = ["//visibility:public"],
)
# We don't want alpha and beta releases to show on ArtifactHUB as releases.
# To prevent pre-releases from appearing, we use the ArtifactHUB-specific:
#
# annotation:
# artifacthub.io/prerelease: "true"
#
# See https://artifacthub.io/docs/topics/annotations/helm/
genrule(
name = "chart-yaml",
srcs = [
"Chart.template.yaml",
"//:version",
],
outs = ["Chart.yaml"],
cmd = """
IS_PRERELEASE=$$(grep -q '^v[0-9]\\+.[0-9]\\+.[0-9]\\+$$' $(location //:version) && echo "false" || echo "true")
sed -e "s:{{IS_PRERELEASE}}:$${IS_PRERELEASE}:g" < $(location Chart.template.yaml) > $@
""",
stamp = 1,
visibility = ["//visibility:public"],
)
filegroup(
name = "chart-srcs",
srcs = ["//deploy/charts/cert-manager/templates:chart-srcs"] + glob(

View File

@ -16,3 +16,5 @@ sources:
maintainers:
- name: cert-manager-maintainers
email: cert-manager-maintainers@googlegroups.com
annotations:
artifacthub.io/prerelease: "{{IS_PRERELEASE}}"