woodpecker/.woodpecker/helm.yml
6543 17fd76b23f
Fix helm chart release (#715)
* fix helm chart release

* make it pass
2022-01-24 11:41:39 +01:00

49 lines
1.9 KiB
YAML

pipeline:
set-version:
image: alpine/helm:3.5.3
commands:
# use tag name or 0.0.0 if not running on a tag
- export CHART_VERSION="${CI_COMMIT_TAG##v}"
- export CHART_VERSION=$${CHART_VERSION:=0.0.0}
- echo "Version $CHART_VERSION"
- sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-agent/Chart.yaml
- sed -i "s/<version>/$CHART_VERSION/g" charts/woodpecker-server/Chart.yaml
- cat charts/woodpecker-agent/Chart.yaml
- cat charts/woodpecker-server/Chart.yaml
when:
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"
lint:
image: alpine/helm:3.5.3
commands:
- helm lint charts/woodpecker-agent/
- helm lint charts/woodpecker-server/
when:
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"
release:
image: quay.io/helmpack/chart-releaser:v1.2.1
secrets:
- source: github_token
target: CR_TOKEN
commands:
- git config --global user.email "woodpecker-bot@obermui.de"
- git config --global user.name "woodpecker-bot"
- mkdir -p .cr-index
- cr package charts/woodpecker-server
- cr package charts/woodpecker-agent
- cr upload --token ${CR_TOKEN} --owner woodpecker-ci --git-repo woodpecker-ci.github.io --release-name-template "helm-{{ .Name }}-{{ .Version }}"
- git clone https://github.com/woodpecker-ci/woodpecker-ci.github.io.git
- cd woodpecker-ci.github.io/ && cr index --token ${CR_TOKEN} --owner woodpecker-ci --git-repo woodpecker-ci.github.io --pages-branch master --package-path ../.cr-release-packages --index-path ../.cr-index/index.yaml --charts-repo https://woodpecker-ci.org --push --release-name-template "helm-{{ .Name }}-{{ .Version }}"
when:
event: tag
path:
include:
- "charts/**"
- ".woodpecker/helm.yml"