-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from ccremer/helm-chart-integrate
Migrate Helm chart to this Git repository
- Loading branch information
Showing
44 changed files
with
2,098 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
## Summary | ||
|
||
* Short summary of what's included in the PR | ||
* Give special note to breaking changes: List the exact changes or provide links to documentation. | ||
|
||
## Checklist | ||
|
||
<!-- | ||
Do *not* mix code changes with chart changes, it will break the release process. | ||
Delete the checklist section that doesn't apply to the change. | ||
--> | ||
|
||
### For Code changes | ||
|
||
- [ ] Categorize the PR by setting a good title and adding one of the labels: | ||
`kind:bug`, `kind:enhancement`, `kind:documentation`, `kind:change`, `kind:breaking`, `kind:dependency` | ||
as they show up in the changelog | ||
- [ ] PR contains the label `area:provisioner` | ||
- [ ] Link this PR to related issues | ||
- [ ] I have not made _any_ changes in the `charts/` directory. | ||
|
||
### For Helm Chart changes | ||
|
||
- [ ] Categorize the PR by setting a good title and adding one of the labels: | ||
`kind:bug`, `kind:enhancement`, `kind:documentation`, `kind:change`, `kind:breaking`, `kind:dependency` | ||
as they show up in the changelog | ||
- [ ] PR contains the label `area:chart` | ||
- [ ] PR contains the chart label, e.g. `chart:kubernetes-zfs-provisioner` | ||
- [ ] Variables are documented in the values.yaml using the format required by [Helm-Docs](https://github.com/norwoodj/helm-docs#valuesyaml-metadata). | ||
- [ ] Chart Version bumped if immediate release after merging is planned | ||
- [ ] I have run `make chart-docs` | ||
- [ ] Link this PR to related code release or other issues. | ||
|
||
<!-- | ||
Remove the section and checklist items that do not apply. | ||
For completed items, change [ ] to [x]. | ||
NOTE: these things are not required to open a PR and can be done afterwards, | ||
while the PR is open. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"pr_template": "- ${{TITLE}} (#${{NUMBER}})", | ||
"categories": [ | ||
{ | ||
"title": "## 🚀 Features", | ||
"labels": [ | ||
"kind:enhancement", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🛠️ Minor Changes", | ||
"labels": [ | ||
"kind:change", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🔎 Breaking Changes", | ||
"labels": [ | ||
"kind:breaking", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🐛 Fixes", | ||
"labels": [ | ||
"kind:bug", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 📄 Documentation", | ||
"labels": [ | ||
"kind:documentation", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🔗 Dependency Updates", | ||
"labels": [ | ||
"kind:dependency", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
} | ||
], | ||
"template": "This release contains _only_ Helm chart changes\n\n${{CATEGORIZED_COUNT}} changes since ${{FROM_TAG}}\n\n${{CHANGELOG}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
chart="${1}" | ||
|
||
tagPattern="${chart}-(.+)" | ||
chartLabel="chart:${chart}" | ||
|
||
echo ::group::Configuring changelog generator | ||
jq '.tag_resolver.filter.pattern="'$tagPattern'" | .tag_resolver.transformer.pattern="'$tagPattern'" | .categories[].labels += ["'$chartLabel'"]' \ | ||
.github/changelog-charts.json | tee .github/configuration.json | ||
echo ::endgroup:: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
{{ template "chart.sourcesSection" . }} | ||
|
||
{{ template "chart.requirementsSection" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{ template "chart.header" . }} | ||
{{ template "chart.deprecationWarning" . }} | ||
|
||
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} | ||
|
||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.homepageLine" . }} | ||
|
||
## Installation | ||
|
||
```bash | ||
helm repo add zfs-provisioner https://ccremer.github.io/kubernetes-zfs-provisioner | ||
helm install {{ template "chart.name" . }} zfs-provisioner/{{ template "chart.name" . }} | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
|
||
chartYaml="${1}" | ||
chartName=$(dirname "${chartYaml}") | ||
|
||
echo "::group::Render chart ${chartName}" | ||
helm template "${chartName}" | ||
echo "::endgroup::" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: ChartLint | ||
|
||
on: | ||
pull_request: | ||
# only run when there are chart changes | ||
paths: | ||
- 'charts/**' | ||
- '!charts/charts.mk' | ||
- '!charts/go*' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Verify charts are upt-do-date | ||
run: make chart-lint | ||
|
||
template: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Render Helm charts | ||
run: find charts -type f -name Chart.yaml -exec .github/render-charts.sh {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: ChartRelease | ||
|
||
on: | ||
push: | ||
tags: | ||
- "[a-z0-9]+-*" # match tags following the 'chart-name-x.y.z' | ||
|
||
jobs: | ||
# Currently this job with changelog generator only works for the k8up chart... | ||
# More charts (e.g. forks) may need additional engineering to get the changelog right. | ||
gh-pages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download cr | ||
uses: giantswarm/[email protected] | ||
with: | ||
binary: cr | ||
version: "1.4.0" | ||
download_url: https://github.com/helm/chart-releaser/releases/download/v${version}/chart-releaser_${version}_linux_amd64.tar.gz | ||
tarball_binary_path: "${binary}" | ||
smoke_test: "${binary} version" | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- uses: actions/setup-go@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Configure Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Get chart name | ||
run: echo "CHART_NAME=$(echo ${GITHUB_REF##*/} | grep --perl-regexp --only-matching '^([a-zA-Z0-9-]+)(?![0-9.]+)')" >> $GITHUB_ENV | ||
|
||
- name: Get chart versions | ||
run: | | ||
echo "CHART_VERSION=$(yq e '.version' charts/${CHART_NAME}/Chart.yaml)" >> $GITHUB_ENV | ||
echo "PREVIOUS_CHART_VERSION=$(git tag --sort=taggerdate --list "k8up-*" | tail -n 2 | head -n 1 | rev | cut -d - -f 1 | rev)" >> $GITHUB_ENV | ||
- name: Prepare changelog config | ||
run: .github/changelog-charts.sh ${CHART_NAME} | ||
|
||
- name: Generate additional artifacts | ||
run: make chart-prepare | ||
|
||
- name: Package Helm chart | ||
run: | | ||
mkdir -p .cr-index | ||
cr package charts/${CHART_NAME} | ||
cr upload | ||
cr index --push | ||
env: | ||
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CR_OWNER: ${{ github.repository_owner }} | ||
CR_GIT_REPO: ${{ github.event.repository.name }} | ||
|
||
- name: Build changelog from PRs with labels | ||
id: build_changelog | ||
uses: mikepenz/release-changelog-builder-action@v3 | ||
with: | ||
configuration: ".github/configuration.json" | ||
ignorePreReleases: true | ||
outputFile: .github/release-notes.md | ||
fromTag: ${{ env.CHART_NAME }}-${{ env.PREVIOUS_CHART_VERSION }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# there doesn't seem to be any maintained GitHub actions that allow uploading assets after release has been made. | ||
- name: Update release | ||
run: | | ||
gh release upload ${CHART_NAME}-${CHART_VERSION} k8up-crd.yaml | ||
gh release edit ${CHART_NAME}-${CHART_VERSION} --notes-file .github/release-notes.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ChartTest | ||
|
||
on: | ||
pull_request: | ||
# only run when there are chart changes | ||
paths: | ||
- 'charts/**' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: actions/setup-go@v3 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Run chart tests | ||
run: make chart-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.