From 34bbd3e3dac42c5e6d71f3847705abc0dd4ab95f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=E1=B4=87=CA=80=C9=B4=E1=B4=85=20S=E1=B4=84=CA=9C?= =?UTF-8?q?=E1=B4=8F=CA=80=C9=A2=E1=B4=87=CA=80s?= <6213398+bjw-s@users.noreply.github.com> Date: Tue, 26 Jan 2021 20:31:43 +0100 Subject: [PATCH] [template] Move template chart to outer folder (#518) * [template] Move template chart to outer folder * Revert workflow change --- .github/workflows/charts-lint-test.yaml | 6 +-- .taskfiles/Taskfile_chart.yml | 3 +- .taskfiles/Taskfile_darwin.yml | 37 +++++++++++++++++-- .taskfiles/Taskfile_linux.yml | 17 ++++----- .../.template => templates/chart}/Chart.yaml | 0 {charts/.template => templates/chart}/OWNERS | 0 .../.template => templates/chart}/README.md | 0 .../chart}/templates/NOTES.txt | 0 .../chart}/templates/common.yaml | 0 .../.template => templates/chart}/values.yaml | 0 10 files changed, 46 insertions(+), 17 deletions(-) rename {charts/.template => templates/chart}/Chart.yaml (100%) rename {charts/.template => templates/chart}/OWNERS (100%) rename {charts/.template => templates/chart}/README.md (100%) rename {charts/.template => templates/chart}/templates/NOTES.txt (100%) rename {charts/.template => templates/chart}/templates/common.yaml (100%) rename {charts/.template => templates/chart}/values.yaml (100%) diff --git a/.github/workflows/charts-lint-test.yaml b/.github/workflows/charts-lint-test.yaml index 6340ec5c..de158314 100644 --- a/.github/workflows/charts-lint-test.yaml +++ b/.github/workflows/charts-lint-test.yaml @@ -38,14 +38,14 @@ jobs: echo "::set-output name=changed::true" 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 echo "::set-output name=common::true" fi - name: Run chart-testing (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' unittest: @@ -105,7 +105,7 @@ jobs: if: needs.lint.outputs.changed == 'true' || needs.lint.outputs.common == 'true' - 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' - name: Run chart-testing (common-test) diff --git a/.taskfiles/Taskfile_chart.yml b/.taskfiles/Taskfile_chart.yml index 8b5ab605..f2eab013 100644 --- a/.taskfiles/Taskfile_chart.yml +++ b/.taskfiles/Taskfile_chart.yml @@ -6,7 +6,7 @@ tasks: create: desc: create new chart 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='*.*' - task: dependency - 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}} deps: - check-chart + silent: true dependency: diff --git a/.taskfiles/Taskfile_darwin.yml b/.taskfiles/Taskfile_darwin.yml index f40535ef..eacf73fd 100644 --- a/.taskfiles/Taskfile_darwin.yml +++ b/.taskfiles/Taskfile_darwin.yml @@ -1,10 +1,41 @@ --- 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: - default: + + install: + desc: Install all developer dependencies + deps: + - distrib-requirements + - go-replace + + distrib-requirements: + desc: Check needed distribution packages 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 diff --git a/.taskfiles/Taskfile_linux.yml b/.taskfiles/Taskfile_linux.yml index f07c6ddc..743914f0 100644 --- a/.taskfiles/Taskfile_linux.yml +++ b/.taskfiles/Taskfile_linux.yml @@ -32,36 +32,33 @@ tasks: helm: desc: Install helm client cmds: + - echo "Installing helm" - wget -q -O - "$URL_HELM" | USE_SUDO=false HELM_INSTALL_DIR=.bin bash status: - test -e .bin/helm deps: - distrib-requirements + silent: true pre-commit: desc: Install a precommit pip package cmds: + - echo "Installing pre-commit" - python3 -m pip install --user pre-commit status: - type pre-commit deps: - distrib-requirements - - # 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 + silent: true go-replace: desc: Install go-replace 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 status: - test -e .bin/go-replace deps: - distrib-requirements + silent: true diff --git a/charts/.template/Chart.yaml b/templates/chart/Chart.yaml similarity index 100% rename from charts/.template/Chart.yaml rename to templates/chart/Chart.yaml diff --git a/charts/.template/OWNERS b/templates/chart/OWNERS similarity index 100% rename from charts/.template/OWNERS rename to templates/chart/OWNERS diff --git a/charts/.template/README.md b/templates/chart/README.md similarity index 100% rename from charts/.template/README.md rename to templates/chart/README.md diff --git a/charts/.template/templates/NOTES.txt b/templates/chart/templates/NOTES.txt similarity index 100% rename from charts/.template/templates/NOTES.txt rename to templates/chart/templates/NOTES.txt diff --git a/charts/.template/templates/common.yaml b/templates/chart/templates/common.yaml similarity index 100% rename from charts/.template/templates/common.yaml rename to templates/chart/templates/common.yaml diff --git a/charts/.template/values.yaml b/templates/chart/values.yaml similarity index 100% rename from charts/.template/values.yaml rename to templates/chart/values.yaml