Skip to content
Snippets Groups Projects
Verified Commit f72a1d6f authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

try to use remote gitlab ci

parent de47aea4
No related branches found
No related tags found
1 merge request!3publish helm chart to package registry
Pipeline #10333 passed with stages
in 57 seconds
# Default image for helm-related jobs
image:
name: alpine/helm:3.7.1
entrypoint: ["/bin/sh", "-c"]
include:
remote: https://open.greenhost.net/stackspin/stackspin/-/raw/host-chart-publish-defaults/.gitlab/ci_templates/helm_package.yml
variables:
CHART_NAME: local-path-provisioner
CHART_DIR: deploy/chart
stages:
- build-project
......@@ -36,51 +38,3 @@ build-container:
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/ --dockerfile ${CI_PROJECT_DIR}/package/Dockerfile --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CI_COMMIT_REF_NAME}
# Only package a new chart once the version number has been updated
.chart_release_rules:
rules:
- changes:
- deploy/chart/Chart.yaml
lint-helm:
stage: lint-helm-chart
script:
- cd deploy/chart
- helm dep update
- helm lint .
artifacts:
paths:
- 'deploy/chart/charts/**'
expire_in: 1 week
# Even if lint fails, upload the charts/ folder as artifact
rules:
- changes:
- 'deploy/chart/*.yaml'
- deploy/chart/templates/*.yaml
package-chart:
stage: package-helm-chart
script:
- cd deploy/chart
- helm package .
artifacts:
paths:
- deploy/chart/local-path-provisioner-*
expire_in: 1 week
extends:
- .chart_release_rules
# Push helm chart. Charts on the `main` branch are pushed to `stable`, others
# are pushed to the `unstable` channel.
release-helm:
image: "rancher/curlimages-curl:7.73.0"
stage: release-helm-chart
script:
- cd deploy/chart
- if [ "$CI_COMMIT_BRANCH" == "main" ]; then export HELM_CHANNEL='stable'; else export HELM_CHANNEL='unstable'; fi
- export CHART_FILE=$(ls local-path-provisioner-*.tgz)
- curl --fail --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${CHART_FILE}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/${HELM_CHANNEL}/charts"
extends:
- .chart_release_rules
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