[template] Move template chart to outer folder (#518)

* [template] Move template chart to outer folder

* Revert workflow change
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2021-01-26 20:31:43 +01:00 committed by GitHub
parent 5e86ce93b7
commit 34bbd3e3da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 46 additions and 17 deletions

View File

@ -38,14 +38,14 @@ jobs:
echo "::set-output name=changed::true" echo "::set-output name=changed::true"
fi fi
changed_unfiltered=$(ct list-changed --config .github/ct.yaml --excluded-charts ".template") changed_unfiltered=$(ct list-changed --config .github/ct.yaml --excluded-charts "")
if [[ $(grep -E "^charts/common(-test)?$" <<< "$changed_unfiltered") ]]; then if [[ $(grep -E "^charts/common(-test)?$" <<< "$changed_unfiltered") ]]; then
echo "::set-output name=common::true" echo "::set-output name=common::true"
fi fi
- name: Run chart-testing (lint) - name: Run chart-testing (lint)
id: lint id: lint
run: ct lint --config .github/ct.yaml --excluded-charts ".template" run: ct lint --config .github/ct.yaml --excluded-charts ""
if: steps.list-changed.outputs.changed == 'true' || steps.list-changed.outputs.common == 'true' if: steps.list-changed.outputs.changed == 'true' || steps.list-changed.outputs.common == 'true'
unittest: unittest:
@ -105,7 +105,7 @@ jobs:
if: needs.lint.outputs.changed == 'true' || needs.lint.outputs.common == 'true' if: needs.lint.outputs.changed == 'true' || needs.lint.outputs.common == 'true'
- name: Run chart-testing (install) - name: Run chart-testing (install)
run: ct install --config .github/ct.yaml --excluded-charts ".template" run: ct install --config .github/ct.yaml --excluded-charts ""
if: needs.lint.outputs.changed == 'true' if: needs.lint.outputs.changed == 'true'
- name: Run chart-testing (common-test) - name: Run chart-testing (common-test)

View File

@ -6,7 +6,7 @@ tasks:
create: create:
desc: create new chart desc: create new chart
cmds: cmds:
- cp -r {{.GIT_ROOT}}/charts/.template {{.GIT_ROOT}}/charts/{{.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='*.*' - ./.bin/go-replace -s '${CHARTNAME}' -r "{{.CHART}}" --path={{.GIT_ROOT}}/charts/{{.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}} successfully generated, you can now edit chart informations ( Chart.yaml and values.yaml )"
@ -14,6 +14,7 @@ tasks:
- test -d {{.GIT_ROOT}}/charts/{{.CHART}} - test -d {{.GIT_ROOT}}/charts/{{.CHART}}
deps: deps:
- check-chart - check-chart
silent: true
dependency: dependency:

View File

@ -1,10 +1,41 @@
--- ---
version: '3' version: '3'
# Todo: add darwin requirements # Todo: add all darwin requirements
env:
URL_GOREPLACE: https://github.com/webdevops/go-replace/releases/download/1.1.2/gr-64-osx
tasks: tasks:
default:
install:
desc: Install all developer dependencies
deps:
- distrib-requirements
- go-replace
distrib-requirements:
desc: Check needed distribution packages
cmds: cmds:
- task -l - task deps:need BIN=wget
- task deps:need BIN=python3
- task deps:need BIN=docker
silent: true
need:
desc: Check needed binary is present
cmds:
- type {{.BIN}} 2>&1 >/dev/null || (echo "Please install {{.BIN}}"; exit 1)
silent: true
go-replace:
desc: Install go-replace
cmds:
- echo "Installing go-replace"
- mkdir -p ".bin"
- wget -q "https://github.com/webdevops/go-replace/releases/download/1.1.2/gr-64-osx" -O .bin/go-replace && chmod +x .bin/go-replace
status:
- test -e .bin/go-replace
deps:
- distrib-requirements
silent: true silent: true

View File

@ -32,36 +32,33 @@ tasks:
helm: helm:
desc: Install helm client desc: Install helm client
cmds: cmds:
- echo "Installing helm"
- wget -q -O - "$URL_HELM" | USE_SUDO=false HELM_INSTALL_DIR=.bin bash - wget -q -O - "$URL_HELM" | USE_SUDO=false HELM_INSTALL_DIR=.bin bash
status: status:
- test -e .bin/helm - test -e .bin/helm
deps: deps:
- distrib-requirements - distrib-requirements
silent: true
pre-commit: pre-commit:
desc: Install a precommit pip package desc: Install a precommit pip package
cmds: cmds:
- echo "Installing pre-commit"
- python3 -m pip install --user pre-commit - python3 -m pip install --user pre-commit
status: status:
- type pre-commit - type pre-commit
deps: deps:
- distrib-requirements - distrib-requirements
silent: true
# env-replacer:
# desc: Install env-replace binary
# cmds:
# - wget -q "$URL_ENVREPLACER" -O - | tar -xz -C .bin && chmod +x .bin/env-replacer
# status:
# - test -e .bin/env-replacer
# deps:
# - distrib-requirements
go-replace: go-replace:
desc: Install go-replace desc: Install go-replace
cmds: cmds:
# - echo wget -q "$URL_GOREPLACE" -O - | tar -xz -C .bin/ && chmod +x .bin/go-replace - echo "Installing go-replace"
- mkdir -p ".bin"
- wget -q "$URL_GOREPLACE" -O .bin/go-replace && chmod +x .bin/go-replace - wget -q "$URL_GOREPLACE" -O .bin/go-replace && chmod +x .bin/go-replace
status: status:
- test -e .bin/go-replace - test -e .bin/go-replace
deps: deps:
- distrib-requirements - distrib-requirements
silent: true