diff --git a/charts/.utils/gitlab-ci.yaml b/charts/.utils/gitlab-ci.yaml index 668abb7b22ff190016ffbc045ffc00332ef0d89b..0fe89f52ed16c5dce31f598d1c5241d852286572 100644 --- a/charts/.utils/gitlab-ci.yaml +++ b/charts/.utils/gitlab-ci.yaml @@ -16,7 +16,12 @@ chart-package: image: quay.io/helmpack/chart-testing:v3.9.0 script: - export TMP_DIR=$(mktemp -d) - - helm package charts/${CHART} -d "$TMP_DIR" + - | + if [ -f "$HELM_SIGNING_KEY" ]; then + gpg --import "$HELM_SIGNING_KEY" + export HELM_SIGN="--sign --key \"$HELM_SIGNING_NAME\"" + fi + - helm package charts/${CHART} ${HELM_SIGN} -d "$TMP_DIR" - for i in $(ls $TMP_DIR/*.tgz); do curl --request POST --user "gitlab-ci-token:$CI_JOB_TOKEN" --form "chart=@${i}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${CI_COMMIT_REF_SLUG}/charts"; done rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"' @@ -64,4 +69,4 @@ chart-helm-unittest: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"' changes: paths: - - charts/${CHART}/**/* \ No newline at end of file + - charts/${CHART}/**/*