Skip to content

Instantly share code, notes, and snippets.

@rverchere
Last active April 4, 2022 20:36
Show Gist options
  • Save rverchere/4285268534dd0e5afbdf86ff21632d18 to your computer and use it in GitHub Desktop.
Save rverchere/4285268534dd0e5afbdf86ff21632d18 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
cat <<EOF
include: '/gci-templates/.gitlab-ci.yml'
stages:
- test
- install
- release
EOF
for f in $(find charts/* -maxdepth 0 -type d)
do
CHART_VERSION=$(grep "^version:" ${f}/Chart.yaml | cut -d' ' -f2-)
CHART_RELEASE="${f##*/}-${CHART_VERSION}"
cat <<EOF
'${f##*/}:lint':
stage: test
extends: .lint
variables:
HELM_NAME: "${f##*/}"
rules:
- if: '\$CI_COMMIT_TAG =~ "/^$/"'
changes:
- ${f}/**/*
'${f##*/}:release':
stage: release
extends: .release
variables:
HELM_NAME: "${f##*/}"
rules:
- if: '\$CI_COMMIT_TAG =~ "/^$/"'
changes:
- ${f}/Chart.yaml
EOF
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment