-
Notifications
You must be signed in to change notification settings - Fork 69
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 #705 from k8up-io/helm-repo
Integrate K8up Helm chart
- Loading branch information
Showing
57 changed files
with
2,942 additions
and
52 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 |
---|---|---|
@@ -1,26 +1,37 @@ | ||
## 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 | ||
|
||
<!-- | ||
Thank you for your pull request. Please provide a description above and | ||
review the checklist below. | ||
--> | ||
### For Code changes | ||
|
||
## Checklist | ||
<!-- | ||
Remove items that do not apply. For completed items, change [ ] to [x]. | ||
--> | ||
- [ ] Categorize the PR by setting a good title and adding one of the labels: | ||
`bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency` | ||
as they show up in the changelog | ||
- [ ] PR contains the label `area:operator` | ||
- [ ] Link this PR to related issues | ||
- [ ] I have not made _any_ changes in the `charts/` directory. | ||
|
||
### For Helm Chart changes | ||
|
||
- [ ] Keep pull requests small so they can be easily reviewed. | ||
- [ ] Categorize the PR by setting a good title and adding one of the labels: | ||
`bug`, `enhancement`, `documentation`, `change`, `breaking`, | ||
as they show up in the changelog | ||
- [ ] Update the documentation. | ||
- [ ] Update tests. | ||
- [ ] Link this PR to related issues. | ||
`bug`, `enhancement`, `documentation`, `change`, `breaking`, `dependency` | ||
as they show up in the changelog | ||
- [ ] PR contains the label `area:chart` | ||
- [ ] PR contains the chart label, e.g. `chart:appcat-service-s3` | ||
- [ ] 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. | ||
|
||
<!-- | ||
NOTE: these things are not required to open a PR and can be done afterwards, | ||
NOTE: | ||
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. | ||
NOTE: | ||
These things are not required to open a PR and can be done afterwards, | ||
while the PR is open. | ||
--> |
Empty file.
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": [ | ||
"enhancement", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🛠️ Minor Changes", | ||
"labels": [ | ||
"change", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🔎 Breaking Changes", | ||
"labels": [ | ||
"breaking", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🐛 Fixes", | ||
"labels": [ | ||
"bug", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 📄 Documentation", | ||
"labels": [ | ||
"documentation", | ||
"area:chart" | ||
], | ||
"exhaustive": true | ||
}, | ||
{ | ||
"title": "## 🔗 Dependency Updates", | ||
"labels": [ | ||
"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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
{{ template "chart.sourcesSection" . }} | ||
|
||
{{ template "chart.requirementsSection" . }} | ||
|
||
<!--- | ||
Common/Useful Link references from values.yaml | ||
--> | ||
[resource-units]: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes | ||
[prometheus-operator]: https://github.com/coreos/prometheus-operator |
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.badgesSection" . }} | ||
|
||
{{ template "chart.description" . }} | ||
|
||
{{ template "chart.homepageLine" . }} | ||
|
||
## Installation | ||
|
||
```bash | ||
helm repo add k8up-io https://k8up-io.github.io/k8up | ||
helm install {{ template "chart.name" . }} k8up-io/{{ template "chart.name" . }} | ||
``` |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
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 | ||
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: 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-z]+-*" # 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} .github/crds.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,27 @@ | ||
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 | ||
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: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,12 @@ name: Docs | |
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "*" | ||
- "v*" | ||
paths-ignore: | ||
- charts/** | ||
|
||
jobs: | ||
antora: | ||
|
@@ -17,6 +21,7 @@ jobs: | |
run: | | ||
git config user.name "Antora via GitHub Actions" | ||
git config user.email "[email protected]" | ||
- name: Parse semver string | ||
id: semver | ||
uses: booxmedialtd/ws-action-parse-semver@v1 | ||
|
@@ -42,10 +47,13 @@ jobs: | |
continue-on-error: true | ||
|
||
- name: Patch Antora file for Release | ||
run: yq eval 'del(.prerelease) | del (.display_version) | .version = "${{ env.MINOR_VERSION }}"' -i docs/antora.yml | ||
run: | | ||
yq eval 'del(.prerelease) | del (.display_version) | .version = "${{ env.MINOR_VERSION }}" | .asciidoc.attributes.releaseVersion = "v${{ steps.semver.outputs.fullversion }}"' -i docs/antora.yml | ||
if: ${{ steps.semver.outputs.prerelease == '' }} | ||
- name: Patch Antora file for Prerelease | ||
run: yq eval 'del (.display_version) | .version = "${{ env.MINOR_VERSION }}", .prerelease = "-${{ steps.semver.outputs.prerelease }}"' -i docs/antora.yml | ||
run: | | ||
yq eval 'del (.display_version) | .version = "${{ env.MINOR_VERSION }}" | .prerelease = "-${{ steps.semver.outputs.prerelease }}" | .asciidoc.attributes.releaseVersion = "v${{ steps.semver.outputs.fullversion }}"' -i docs/antora.yml | ||
cat docs/antora.yml | ||
if: ${{ steps.semver.outputs.prerelease != '' }} | ||
|
||
- name: Commit | ||
|
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
Oops, something went wrong.