--- version: '3' tasks: create: desc: create new chart cmds: - git checkout -b add-chart-{{.CHART}} - cp -r {{.GIT_ROOT}}/templates/chart {{.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 silent: true 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 ct-lint: desc: Run `ct lint` on 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