charts/.taskfiles/Taskfile_chart.yml
Bruno Adele 5e86ce93b7
Add a contributing helper, for helping creating new chart (#508)
Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
2021-01-26 13:17:14 -05:00

47 lines
1.5 KiB
YAML

---
version: '3'
tasks:
create:
desc: create new chart
cmds:
- cp -r {{.GIT_ROOT}}/charts/.template {{.GIT_ROOT}}/charts/{{.CHART}}
- ./.bin/go-replace -s '${CHARTNAME}' -r "{{.CHART}}" --path={{.GIT_ROOT}}/charts/{{.CHART}} --path-pattern='*.*'
- task: dependency
- echo "Congratulations, charts/{{.CHART}} successfully generated, you can now edit chart informations ( Chart.yaml and values.yaml )"
status:
- test -d {{.GIT_ROOT}}/charts/{{.CHART}}
deps:
- check-chart
dependency:
cmds:
- test -d {{.GIT_ROOT}}/charts/{{.CHART}}/Chart.lock && rm {{.GIT_ROOT}}/charts/{{.CHART}}/Chart.lock || exit 0
- test -d {{.GIT_ROOT}}/charts/{{.CHART}}/tmpcharts && rm -rf {{.GIT_ROOT}}/charts/{{.CHART}}/tmpcharts || exit 0
- cd {{.GIT_ROOT}}/charts/{{.CHART}} && helm dependency update
silent: true
lint:
desc: lint your chart code
cmds:
- cd {{.GIT_ROOT}}/charts/{{.CHART}} && helm lint
deps:
- dependency
- check-chart
test:
desc: test your chart code
cmds:
- docker run --rm -it --user $(id -u):$(id -g) -e "HELM_CONFIG_HOME=/tmp/helm" -e "HELM_CACHE_HOME=/tmp/helm" -v {{.GIT_ROOT}}:/ci -w /ci quay.io/helmpack/chart-testing:latest ct lint --charts charts/{{.CHART}} --config /ci/.github/ct.yaml
deps:
- check-chart
- lint
# Checks Parameters
check-chart:
cmds:
- cmd: test ! -z "{{.CHART}}" || (echo "Please define CHART parameter"; exit 1)
silent: true