Skip to content
Snippets Groups Projects
Verified Commit e3a70f30 authored by Sheogorath's avatar Sheogorath :european_castle:
Browse files

ci(charts): Fix broken CI rules

Currently gitlab-ci doesn't allow variables in `exists` rules, which
means the condition below can't be used. This is fixed by moving the
condition into the script and just exit successful if the tests don't
exist.

Further it adds a requirement for the chart-package job to wait for the
chart-helm-unittest job(s) before, this should help to prevent the
release of broken charts.

Finally we namespace the junit files generated during the tests, since
they would overwrite each other, if multiple helm charts would run the
CI jobs at the same time.

References:
https://docs.gitlab.com/ee/ci/yaml/#needs
https://docs.gitlab.com/ee/ci/yaml/#rulesexists
parent e62b2950
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@
chart-package:
stage: build
extends: .chart-matrix
needs:
- chart-helm-unittest
image: quay.io/helmpack/chart-testing:v3.6.0
script:
- export TMP_DIR=$(mktemp -d)
......@@ -25,15 +27,14 @@ chart-helm-unittest:
name: docker.io/quintush/helm-unittest:3.10.0-0.2.9
entrypoint: [""]
script:
- helm unittest -3 -o helm-unittest.xml -t junit charts/${CHART}
- if [ ! -e charts/${CHART}/tests ]; then echo "No helm unittests"; exit 0; fi
- helm unittest -3 -o helm-unittest-${CHART}.xml -t junit charts/${CHART}
artifacts:
when: always
reports:
junit:
- helm-unittest.xml
- helm-unittest-${CHART}.xml
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
changes:
- charts/${CHART}/**/*
exists:
- charts/${CHART}/tests/**/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment