Skip to content

Commit b554422

Browse files
authored
add renovatebot self hosted app and update helm chart docker tag to v0.6.0 (#37)
* add renovatebot self hosted app and update helm chart docker tag to v0.6.0 * add automated helm docs updates
1 parent eda147b commit b554422

File tree

7 files changed

+154
-14
lines changed

7 files changed

+154
-14
lines changed

.github/renovate-config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"onboarding": false,
4+
"username": "renovate-release",
5+
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
6+
"platform": "github",
7+
"repositories": [
8+
"small-hack/appset-secret-plugin"
9+
],
10+
"allowedPostUpgradeCommands": ["^scripts"]
11+
}

.github/workflows/helm-docs.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Generate helm docs
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'charts/matrix/**'
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update-docs:
14+
name: update-docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
ref: ${{ github.event.pull_request.head.ref }}
21+
22+
- name: Render helm docs inside the README.md and push changes back to PR branch
23+
uses: netfoundry/helm-docs-action@v1
24+
with:
25+
working-dir: charts/matrix
26+
git-push: "true"

.github/workflows/renovate.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Renovate
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
# This should be every hour
6+
- cron: '0 * * * *'
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- ".github/renovate-config.json"
12+
- ".github/workflows/renovate.yml"
13+
- "renovate.json"
14+
- "scripts/**"
15+
jobs:
16+
renovate:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Get token
20+
id: app-token
21+
uses: actions/create-github-app-token@v1
22+
with:
23+
private-key: ${{ secrets.PRIVATE_KEY }}
24+
app-id: ${{ secrets.APP_ID }}
25+
26+
- name: Checkout
27+
uses: actions/checkout@v4.1.7
28+
29+
- name: Self-hosted Renovate
30+
uses: renovatebot/github-action@v40.1.12
31+
with:
32+
token: '${{ steps.app-token.outputs.token }}'
33+
configurationFile: .github/renovate-config.json

charts/appset-secret-plugin/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ maintainers:
1515
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
1616
type: application
1717

18-
version: 0.7.0
18+
version: 0.8.0
1919

2020
# renovate: image=jessebot/argocd-appset-secret-plugin
21-
appVersion: "v0.5.0"
21+
appVersion: "v0.6.0"

charts/appset-secret-plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# appset-secret-plugin
22

3-
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.5.0](https://img.shields.io/badge/AppVersion-v0.5.0-informational?style=flat-square)
3+
![Version: 0.8.0](https://img.shields.io/badge/Version-0.8.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.6.0](https://img.shields.io/badge/AppVersion-v0.6.0-informational?style=flat-square)
44

55
A Helm chart for adding a K8s Secret Plugin Generator to Argo CD ApplicationSets
66

renovate.json

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,54 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"config:base"
5-
],
6-
"regexManagers": [
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended", ":disableDependencyDashboard"
5+
],
6+
"customManagers": [
77
{
8-
"fileMatch": ["(^|/)Chart\\.yaml$"],
9-
"matchStrings": [
10-
"#\\s?renovate: image=(?<depName>.*?)\\s?appVersion:\\s?\\\"?(?<currentValue>[\\w+\\.\\-]*)",
11-
],
12-
"datasourceTemplate": "docker"
13-
},
8+
"customType": "regex",
9+
"datasourceTemplate": "docker",
10+
"fileMatch": [
11+
"(^|/)Chart\\.yaml$"
12+
],
13+
"matchStrings": [
14+
"#\\s*renovate: image=(?<depName>.*?)\\s+appVersion:\\s*[\"']?(?<currentValue>[\\w+\\.\\-]*)"
15+
]
16+
}
17+
],
18+
"packageRules": [
19+
{
20+
"description": "Fix subchart archives for helm chart",
21+
"matchManagers": ["helmv3"],
22+
"postUpdateOptions": ["helmUpdateSubChartArchives"]
23+
},
24+
{
25+
"description": "Fix version in Chart.yaml after helmv3 dep patch updates",
26+
"matchManagers": ["helmv3"],
27+
"matchUpdateTypes": ["patch"],
28+
"bumpVersion": "patch"
29+
},
30+
{
31+
"description": "Fix version in Chart.yaml after helmv3 dep minor updates",
32+
"matchManagers": ["helmv3"],
33+
"matchUpdateTypes": ["minor"],
34+
"bumpVersion": "minor"
35+
},
36+
{
37+
"description": "Fix version in Chart.yaml after helmv3 dep major updates",
38+
"matchManagers": ["helmv3"],
39+
"matchUpdateTypes": ["major"],
40+
"bumpVersion": "major"
41+
},
42+
{
43+
"description": "Bump helm chart versions by a patch when updating values files. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.",
44+
"matchManagers": ["helm-values", "regex"],
45+
"postUpgradeTasks": {
46+
"commands": [
47+
"scripts/bump-chart-version.sh '{{{updateType}}}'"
48+
],
49+
"fileFilters": ["**/Chart.yaml"],
50+
"executionMode": "branch"
51+
}
52+
}
1453
]
1554
}

scripts/bump-chart-version.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
# thanks to original comment: https://github.com/renovatebot/renovate/issues/8231#issuecomment-1978929997
3+
# converted to discussion: https://github.com/renovatebot/renovate/discussions/28861#discussioncomment-9326722
4+
5+
set -euo pipefail
6+
7+
update_type="$1"
8+
version=$(grep "^version:" "./charts/appset-secret-plugin/Chart.yaml" | awk '{print $2}')
9+
10+
if [[ ! $version ]]; then
11+
echo "No valid version was found"
12+
exit 1
13+
fi
14+
15+
major=$(echo "$version" | cut -d. -f1)
16+
minor=$(echo "$version" | cut -d. -f2)
17+
patch=$(echo "$version" | cut -d. -f3)
18+
19+
if [[ "$update_type" =~ (major|replacement) ]]; then
20+
major=$(( major + 1 ))
21+
minor=0
22+
patch=0
23+
elif [[ "$update_type" =~ 'minor' ]]; then
24+
minor=$(( minor + 1 ))
25+
patch=0
26+
else
27+
patch=$(( patch + 1 ))
28+
fi
29+
30+
echo "Bumping version for appset-secret-plugin chart from $version to $major.$minor.$patch"
31+
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/appset-secret-plugin/Chart.yaml"

0 commit comments

Comments
 (0)