diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml new file mode 100644 index 0000000..c729d24 --- /dev/null +++ b/.github/workflows/lint-and-test.yml @@ -0,0 +1,42 @@ +# +# Reference: https://github.com/helm/chart-testing-action +# +name: Linting and Testing +on: pull_request +jobs: + chart-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Setup Chart Linting + id: lint + uses: helm/chart-testing-action@v2.0.1 + + - name: Install Plugins + run: | + helm plugin install https://github.com/quintush/helm-unittest > /dev/null 2>&1 + + - name: Run chart-testing (lint) Helmize + run: ct lint --config ./charts/ct.yaml --lint-conf ./charts/lint.yaml + + - name: Run chart-testing (lint) Examples + run: ct lint --config ./examples/ct.yaml + + - name: Create kind cluster + uses: helm/kind-action@v1.2.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) Examples + run: ct install --config ./ct.yaml + if: steps.list-changed.outputs.changed == 'true' diff --git a/.github/workflows/gh-pages.yaml b/.github/workflows/release.yaml similarity index 55% rename from .github/workflows/gh-pages.yaml rename to .github/workflows/release.yaml index 2f8e01e..1ec8826 100644 --- a/.github/workflows/gh-pages.yaml +++ b/.github/workflows/release.yaml @@ -5,6 +5,32 @@ on: branches: - main # Set a branch to deploy jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v1 + + - name: Add dependency chart repos + run: | + helm repo add buttahtoast https://buttahtoast.github.io/helm-charts/ + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.2.0 + with: + charts_dir: charts + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + deploy: runs-on: ubuntu-20.04 concurrency: @@ -34,4 +60,5 @@ jobs: if: ${{ github.ref == 'refs/heads/main' }} with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./hugo/public \ No newline at end of file + publish_dir: ./hugo/public + keep_files: true \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 3a1116a..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Helm Chart Release -on: - push: - branches: - - main -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Install Helm - uses: azure/setup-helm@v1 - - - name: Add dependency chart repos - run: | - helm repo add buttahtoast https://buttahtoast.github.io/helm-charts/ - - name: Configure Git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.2.0 - with: - charts_dir: charts - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" \ No newline at end of file diff --git a/charts/ct.yaml b/charts/ct.yaml new file mode 100644 index 0000000..91b96c7 --- /dev/null +++ b/charts/ct.yaml @@ -0,0 +1,14 @@ +## Reference: https://github.com/helm/chart-testing/blob/master/doc/ct_lint-and-install.md +## +remote: origin +target-branch: main +chart-dirs: + - charts/ +chart-repos: + - buttahtoast=https://buttahtoast.github.io/helm-charts/ +validate-chart-schema: true +validate-maintainers: true +validate-yaml: true +helm-extra-args: "--timeout 600s" +exclude-deprecated: true +debug: true \ No newline at end of file diff --git a/charts/helmize/Chart.yaml b/charts/helmize/Chart.yaml index 2e78f40..3e1f8ed 100644 --- a/charts/helmize/Chart.yaml +++ b/charts/helmize/Chart.yaml @@ -2,15 +2,14 @@ apiVersion: v2 name: helmize description: Go Sprig based deployment engine deployed via Helm type: library -version: "0.1.0-rc.3" +version: "0.1.0-rc.4" appVersion: "0.1.0" home: https://helmize.dev -icon: https://raw.githubusercontent.com/buttahtoast/helmize/main/icons/icon-transparent.png +icon: https://raw.githubusercontent.com/buttahtoast/helmize/main/icon.png dependencies: - name: library version: "2.2.3" - #repository: "file://../../../helm-charts-1/charts/library" - repository: https://buttahtoast.github.io/helm-charts/ + repository: https://buttahtoast.github.io/helm-charts/ keywords: - library - sprig diff --git a/charts/helmize/templates/render/func/files/_parse.tpl b/charts/helmize/bin/_parse.tpl similarity index 100% rename from charts/helmize/templates/render/func/files/_parse.tpl rename to charts/helmize/bin/_parse.tpl diff --git a/charts/helmize/templates/config/_types.tpl b/charts/helmize/templates/config/_types.tpl index 9d3a884..0372ef0 100644 --- a/charts/helmize/templates/config/_types.tpl +++ b/charts/helmize/templates/config/_types.tpl @@ -18,7 +18,10 @@ default: [ ".yaml", ".yml", ".tpl" ] {{ include "inventory.render.defaults.files.identifier_template" $ }}: types: [ "string" ] - default: "inventory.render.func.files.identifier.template" + default: "inventory.render.templates.identifier" +{{ include "inventory.entrypoint.defaults.render_template" $ }}: + types: [ "string" ] + default: "inventory.entrypoint.templates.render" {{ include "inventory.postrenders.defaults.cfg.post_renderers" $ }}: types: [ "slice" ] default: [ "{{ include "inventory.postrenders.defaults.cfg.post_renderers.inject_key" $ }}" ] diff --git a/charts/helmize/templates/entrypoint/_defaults.tpl b/charts/helmize/templates/entrypoint/_defaults.tpl index deb951b..823b6ba 100644 --- a/charts/helmize/templates/entrypoint/_defaults.tpl +++ b/charts/helmize/templates/entrypoint/_defaults.tpl @@ -1,4 +1,4 @@ -{{/* Force