Add CHART_TYPE to tasks (#737)

Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
This commit is contained in:
Vegetto 2021-03-30 12:51:04 +02:00 committed by GitHub
parent 5714a48d9b
commit 9992a5d4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,18 +7,18 @@ tasks:
desc: create new chart desc: create new chart
cmds: cmds:
- git checkout -b add-chart-{{.CHART}} - git checkout -b add-chart-{{.CHART}}
- cp -r {{.GIT_ROOT}}/templates/chart {{.GIT_ROOT}}/charts/{{.CHART}} - cp -r {{.GIT_ROOT}}/templates/chart "{{.GIT_ROOT}}/charts/{{.CHART_TYPE}}/{{.CHART}}"
- ./.bin/go-replace -s '${CHARTNAME}' -r "{{.CHART}}" --path={{.GIT_ROOT}}/charts/{{.CHART}} --path-pattern='*.*' - ./.bin/go-replace -s '${CHARTNAME}' -r "{{.CHART}}" --path="{{.GIT_ROOT}}/charts/{{.CHART_TYPE}}/{{.CHART}}" --path-pattern='*.*'
- task: dependency - task: dependency
- echo "Congratulations, charts/{{.CHART}} successfully generated, you can now edit chart informations ( Chart.yaml and values.yaml )" - echo "Congratulations, charts/{{.CHART_TYPE}}/{{.CHART}} successfully generated, you can now edit chart informations ( Chart.yaml and values.yaml )"
status: status:
- test -d {{.GIT_ROOT}}/charts/{{.CHART}} - test -d "{{.GIT_ROOT}}/charts/{{.CHART_TYPE}}/{{.CHART}}"
deps: deps:
- check-chart - check-chart
silent: true silent: true
dependency: dependency:
dir: "{{.GIT_ROOT}}/charts/{{.CHART}}" dir: "{{.GIT_ROOT}}/charts/{{.CHART_TYPE}}/{{.CHART}}"
cmds: cmds:
- test -d Chart.lock && rm Chart.lock || exit 0 - test -d Chart.lock && rm Chart.lock || exit 0
- test -d tmpcharts && rm -rf tmpcharts || exit 0 - test -d tmpcharts && rm -rf tmpcharts || exit 0
@ -27,7 +27,7 @@ tasks:
lint: lint:
desc: lint your chart code desc: lint your chart code
dir: "{{.GIT_ROOT}}/charts/{{.CHART}}" dir: "{{.GIT_ROOT}}/charts/{{.CHART_TYPE}}/{{.CHART}}"
cmds: cmds:
- helm lint - helm lint
deps: deps:
@ -37,7 +37,7 @@ tasks:
ct-lint: ct-lint:
desc: run `ct lint` on your chart code desc: run `ct lint` on your chart code
cmds: 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-lint.yaml - 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_TYPE}}/{{.CHART}}" --config /ci/.github/ct-lint.yaml
deps: deps:
- check-chart - check-chart
- lint - lint
@ -46,12 +46,13 @@ tasks:
desc: generate helm-docs desc: generate helm-docs
dir: "{{.GIT_ROOT}}/hack" dir: "{{.GIT_ROOT}}/hack"
cmds: cmds:
- ./gen-helm-docs.sh "{{.CHART}}" - ./gen-helm-docs.sh "{{.CHART_TYPE}}" "{{.CHART}}"
deps: deps:
- check-chart - check-chart
# Checks Parameters # Checks Parameters
check-chart: check-chart:
cmds: cmds:
- test ! -z "{{.CHART_TYPE}}" || (echo "Please define CHART_TYPE parameter"; exit 1)
- test ! -z "{{.CHART}}" || (echo "Please define CHART parameter"; exit 1) - test ! -z "{{.CHART}}" || (echo "Please define CHART parameter"; exit 1)
silent: true silent: true