From 03239ab55ddf4fbd2d4f0f2836f14546b52114cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcelo=20Men=C3=A9ndez=20V=C3=A1zquez?= Date: Thu, 15 Apr 2021 17:33:48 +0200 Subject: [PATCH] Cerebro 0.0.2 (#11) * Bump cerebro to 0.0.2 * Move generation of README.md to PR workflow * Add info about how to update the README file * Better filter for changed helm charts * Update README.md for the first time --- .github/workflows/chart-release.yaml | 16 -------------- .github/workflows/pr-helm-lint.yaml | 18 +++++++++++++++- README.md | 31 +++++++++++++++++++++------- charts/cerebro/Chart.yaml | 2 +- docs/README.tpl | 6 +++++- 5 files changed, 47 insertions(+), 26 deletions(-) diff --git a/.github/workflows/chart-release.yaml b/.github/workflows/chart-release.yaml index 7c71ff5..61ca7c3 100644 --- a/.github/workflows/chart-release.yaml +++ b/.github/workflows/chart-release.yaml @@ -11,7 +11,6 @@ on: env: HELM_VERSION: "v3.5.3" - GOMPLATE_VERSION: "v3.9.0" jobs: helm-release: @@ -32,11 +31,6 @@ jobs: with: version: "${{ env.HELM_VERSION }}" - - name: "Install gomplate" - run: | - wget -qO gomplate https://github.com/hairyhenderson/gomplate/releases/download/${{ env.GOMPLATE_VERSION }}/gomplate_linux-amd64-slim - chmod u+x gomplate - - name: "Run chart-releaser" uses: helm/chart-releaser-action@v1.2.0 with: @@ -44,13 +38,3 @@ jobs: charts_repo_url: https://empathyco.github.io/empathy-helm-charts/ env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - - - name: "Generate README.md from template docs/README.tpl to update list of Charts" - run: | - ${GITHUB_WORKSPACE}/gomplate -f ${GITHUB_WORKSPACE}/docs/README.tpl -o ${GITHUB_WORKSPACE}/README.md - - - name: "Commit updated README.md to the branch if changed" - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: "[Automatic] - Update chart list" - file_pattern: README.md diff --git a/.github/workflows/pr-helm-lint.yaml b/.github/workflows/pr-helm-lint.yaml index ef0ded5..7c5e770 100644 --- a/.github/workflows/pr-helm-lint.yaml +++ b/.github/workflows/pr-helm-lint.yaml @@ -11,6 +11,7 @@ on: env: HELM_VERSION: "v3.5.3" + GOMPLATE_VERSION: "v3.9.0" jobs: helm-lint: @@ -30,6 +31,11 @@ jobs: with: version: "${{ env.HELM_VERSION }}" + - name: "Install gomplate binary" + run: | + wget -qO gomplate https://github.com/hairyhenderson/gomplate/releases/download/${{ env.GOMPLATE_VERSION }}/gomplate_linux-amd64-slim + chmod u+x gomplate + - name: "Get Helm Charts changed" uses: jitterbit/get-changed-files@v1 id: updated_files @@ -39,7 +45,7 @@ jobs: - name: "Dump updated Helm Charts folders and validate semantic versioning" run: | - echo "${{ steps.updated_files.outputs.all }}" | tr "," "\n" | awk -F\/ '/\// && !/^\./ {print $2}' | sort | uniq > changed_charts + echo "${{ steps.updated_files.outputs.all }}" | tr "," "\n" | awk -F\/ '/^charts/ && /\// && !/^\./ {print $2}' | sort | uniq > changed_charts while read chart; do # Get Chart version in the current PR branch version=$(awk -F\: '/^version:/ {print $(NF)}' charts/${chart}/Chart.yaml|tr -d " ") @@ -89,3 +95,13 @@ jobs: done < Please avoid updating this README directly, as this file is automatically generated by templating [docs/README.tpl](docs/README.tpl) to keep the list of supported Helm Charts up to date, based on the content of the `charts` folder. +> +>If updating the README is required, please update that template file. It will be rendered as part of the workflow of the Pull Request, and pushed back to the branch of the same. -We are open to contributors, you can contribute to Empathy Helm Charts through code, documentation or bug reports. More information about contributing can be found [here](CONTRIBUTING.md). +This repository is intended for sharing [Helm Charts](https://helm.sh/) maintained by [Empathyco](https://www.empathy.co/). -# Use this repo -```sh +## TL;DR +```bash $ helm repo add empathy-public https://empathyco.github.io/helm-charts $ helm install --name my-release empathy-public/ ``` ![helm-repo-add](docs/helm-repo-add.gif ) -A complete list of supported Helm Charts can be found [here](chart_list.md). +## Install Helm + +Please refer to the official [Helm install guide](https://github.com/helm/helm#install) and ensure that the `helm` binary can be invoked from your `$PATH`. Using tools like [helmenv](https://github.com/little-angry-clouds/kubernetes-binaries-managers/tree/master/cmd/helmenv) can help you using multiple versions of Helm, depending on the version of the Chart you want to work with. + +## Use this repo + +Run the following command to add this repository to your Helm environment, so you can start downloading and installing charts from here: +```bash +$ helm repo add empathy-public https://empathyco.github.io/helm-charts +``` + +## Contributing +We are open to contributors, you can contribute to Empathy Helm Charts through code, documentation or bug reports. More information about contributing can be found [here](CONTRIBUTING.md). + +Following the list complete list of supported Helm Charts: + +* cerebro diff --git a/charts/cerebro/Chart.yaml b/charts/cerebro/Chart.yaml index 950fd86..2ad7aa6 100644 --- a/charts/cerebro/Chart.yaml +++ b/charts/cerebro/Chart.yaml @@ -9,5 +9,5 @@ sources: - https://github.com/lmenezes/cerebro - https://github.com/lmenezes/cerebro-docker maintainers: - - name: Empathy Platform Team + - name: Empathy Platform Team email: ops@empathy.co diff --git a/docs/README.tpl b/docs/README.tpl index 52e9790..6247c48 100644 --- a/docs/README.tpl +++ b/docs/README.tpl @@ -1,5 +1,9 @@ # Empathy Helm Charts +> Please avoid updating this README directly, as this file is automatically generated by templating [docs/README.tpl](docs/README.tpl) to keep the list of supported Helm Charts up to date, based on the content of the `charts` folder. +> +>If updating the README is required, please update that template file. It will be rendered as part of the workflow of the Pull Request, and pushed back to the branch of the same. + This repository is intended for sharing [Helm Charts](https://helm.sh/) maintained by [Empathyco](https://www.empathy.co/). ## TL;DR @@ -27,7 +31,7 @@ Following the list complete list of supported Helm Charts: {{- "\n" -}} {{- $CHARTS := (printf "%v%v" (env.Getenv "GITHUB_WORKSPACE") "/charts") -}} {{- range (file.ReadDir $CHARTS | coll.Sort) -}} -{{- if (file.IsDir (printf "%v%v" $CHARTS "/.")) }} +{{- if (file.IsDir (printf "%v/%v" $CHARTS .)) }} * {{ . }} {{- end -}} {{- end -}}