Skip to content

Commit

Permalink
Cerebro 0.0.2 (#11)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
marcemv90 authored Apr 15, 2021
1 parent c6d3ff1 commit 03239ab
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 26 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/chart-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

env:
HELM_VERSION: "v3.5.3"
GOMPLATE_VERSION: "v3.9.0"

jobs:
helm-release:
Expand All @@ -32,25 +31,10 @@ 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/[email protected]
with:
charts_dir: charts
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
18 changes: 17 additions & 1 deletion .github/workflows/pr-helm-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:

env:
HELM_VERSION: "v3.5.3"
GOMPLATE_VERSION: "v3.9.0"

jobs:
helm-lint:
Expand All @@ -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
Expand All @@ -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 " ")
Expand Down Expand Up @@ -89,3 +95,13 @@ jobs:
done <<EOF
$(cat changed_charts)
EOF
- 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
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
Empathy Helm Charts
===================
# Empathy Helm Charts

This repository is intended for sharing Helm Charts maintained by [Empathyco](https://www.empathy.co/).
> 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/<chartName>
```
![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
2 changes: 1 addition & 1 deletion charts/cerebro/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
6 changes: 5 additions & 1 deletion docs/README.tpl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 -}}

0 comments on commit 03239ab

Please sign in to comment.