diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e040eb666dc76302ca5c1151af6d3980b1dd08ae..3ce77a2949b08434ecfd7ef69da23c2d619a1aa0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,32 +6,42 @@ stages: - package - build +# https://dnsmichi.at/2021/09/23/efficient-pipelines-gitlab-ci-cd-parallel-matrix-builds-reference/ +.charts: + parallel: + matrix: + # - CHART: [personal-gitlab-exporter, restic-rest-server, tmate-ssh-server] + - CHART: [personal-gitlab-exporter] + lint: stage: test image: - name: alpine/helm + name: alpine/helm:3.7.1 entrypoint: ["/bin/sh", "-c"] script: - - find . -maxdepth 1 -type d | egrep -v '^(.|./.git)$' | xargs -n 1 -t helm lint + - helm lint $CHART + parallel: !reference [.charts,parallel] package_charts: stage: package image: - name: linkyard/docker-helm + name: alpine/helm:3.7.1 entrypoint: ["/bin/sh", "-c"] script: - - helm init -c - mkdir public/ - - find . -maxdepth 1 -type d | egrep -v '^(.|./.git|./public)$' | xargs -n 1 -t helm package -d public/ - - helm repo index public/ --url https://charts.oas.varac.net - - apk add markdown - - markdown README.md > public/index.html + - helm package -d public/ $CHART + # - helm repo index public/ --url https://charts.oas.varac.net + # - apk add markdown + # - markdown README.md > public/index.html + - 'chart_filename=$(ls public/${CHART}*)' + - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@${chart_filename}" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"' + parallel: !reference [.charts,parallel] artifacts: paths: - public/ -build_image: - stage: build - variables: - KANIKO_BUILD_IMAGENAME: "helmcharts" - extends: .kaniko_build +# build_image: +# stage: build +# variables: +# KANIKO_BUILD_IMAGENAME: "helmcharts" +# extends: .kaniko_build