Skip to content

Commit 0dc2867

Browse files
authored
feat: add renovate bot (#79)
Closes #78
1 parent 81ab882 commit 0dc2867

File tree

7 files changed

+157
-4
lines changed

7 files changed

+157
-4
lines changed

.github/workflows/renovate.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Renovate
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
dryRun:
7+
description: Dry run
8+
type: boolean
9+
default: false
10+
required: true
11+
logLevel:
12+
description: Log level
13+
type: choice
14+
default: info
15+
options:
16+
- info
17+
- debug
18+
required: true
19+
push:
20+
branches:
21+
- main
22+
paths:
23+
- .renovate/**.json
24+
schedule:
25+
- cron: 0 * * * *
26+
27+
jobs:
28+
renovate:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout
32+
uses: actions/[email protected]
33+
- name: Run renovate
34+
uses: renovatebot/[email protected]
35+
env:
36+
LOG_LEVEL: ${{ inputs.logLevel || 'info' }}
37+
RENOVATE_DRY_RUN: ${{ inputs.dryRun }}
38+
RENOVATE_ONBOARDING: false
39+
RENOVATE_REPOSITORIES: ${{ github.repository }}
40+
RENOVATE_REQUIRE_CONFIG: optional
41+
with:
42+
configurationFile: .renovate/config.json
43+
token: ${{ secrets.RENOVATE_TOKEN }}

.renovate/commit-message.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"commitMessageTopic": "{{depName}}",
3+
"commitMessageExtra": "to {{newVersion}}",
4+
"packageRules": [
5+
{
6+
"matchPackagePatterns": ["*"],
7+
"semanticCommitType": "build"
8+
},
9+
{
10+
"matchDatasources": ["docker"],
11+
"semanticCommitScope": "docker",
12+
"commitMessageTopic": "{{{replace '.+/' '' depName}}}"
13+
},
14+
{
15+
"matchDatasources": ["github-actions", "github-releases", "github-tags"],
16+
"semanticCommitScope": "github",
17+
"commitMessageTopic": "{{depName}}"
18+
},
19+
{
20+
"matchDatasources": ["helm"],
21+
"semanticCommitScope": "helm",
22+
"commitMessageTopic": "{{depName}}"
23+
}
24+
]
25+
}

.renovate/config.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": [
3+
"config:recommended",
4+
"docker:enableMajor",
5+
":disableRateLimiting",
6+
":disableDependencyDashboard",
7+
":semanticCommits",
8+
"github>ocf/kubernetes//.renovate/commit-message",
9+
"github>ocf/kubernetes//.renovate/manager",
10+
"github>ocf/kubernetes//.renovate/pr-label"
11+
],
12+
"prBodyTemplate": "{{{table}}}{{{notes}}}{{{changelogs}}}{{{controls}}}"
13+
}

.renovate/manager.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"customManagers": [
3+
{
4+
"customType": "regex",
5+
"description": "Process comments",
6+
"managerFilePatterns": ["/^apps/.+\\.py$/"],
7+
"matchStrings": [
8+
"# renovate source=(?<datasource>\\S+) name=(?<depName>\\S+)\n[^\n]+:\\s*\"(?<currentValue>[^:\"]+)\"",
9+
"# renovate source=(?<datasource>\\S+) name=(?<depName>\\S+)\n[^\n]+:\\s*\"\\S+:(?<currentValue>[^:\"]+)\""
10+
]
11+
},
12+
{
13+
"customType": "regex",
14+
"description": "Process helm in version.toml",
15+
"managerFilePatterns": ["/^apps/versions\\.toml$/"],
16+
"matchStrings": [
17+
"\\[(?<depName>[^\\]]+)\\]\nversion\\s*=\\s*\"(?<currentValue>[^\"]+)\"\nhelm\\s*=\\s*\"(?<registryUrl>http[^\"]+)\"(?:\n\n|\n$|$)",
18+
"\\[[^\\]]+\\]\nversion\\s*=\\s*\"(?<currentValue>[^\"]+)\"\nhelm\\s*=\\s*\"(?<registryUrl>http[^\"]+)\"\nchart\\s*=\\s*\"(?<depName>[^\"]+)\""
19+
],
20+
"datasourceTemplate": "helm"
21+
},
22+
{
23+
"customType": "regex",
24+
"description": "Process docker in version.toml",
25+
"managerFilePatterns": ["/^apps/versions\\.toml$/"],
26+
"matchStrings": [
27+
"\\[[^\\]]+\\]\nversion\\s*=\\s*\"(?<currentValue>[^\"]+)\"\nhelm\\s*=\\s*\"oci://(?<depName>[^\"]+)\""
28+
],
29+
"datasourceTemplate": "docker"
30+
},
31+
{
32+
"customType": "regex",
33+
"description": "Process github in version.toml",
34+
"managerFilePatterns": ["/^apps/versions\\.toml$/"],
35+
"matchStrings": [
36+
"\\[[^\\]]+\\]\nversion\\s*=\\s*\"(?<currentValue>[^\"]+)\"\ngithub\\s*=\\s*\"https:\\/\\/github.com\\/(?<depName>[^\\/]+\/[^\\/\"\\.]+)[^\"]*\"",
37+
"\\[[^\\]]+\\]\nversion\\s*=\\s*\"(?<currentValue>[^\"]+)\"\nrepo_url\\s*=\\s*\"https:\\/\\/github.com\\/(?<depName>[^\\/]+\/[^\\/\"\\.]+)[^\"]*\""
38+
],
39+
"datasourceTemplate": "github-releases"
40+
}
41+
]
42+
}

.renovate/pr-label.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"packageRules": [
3+
{
4+
"matchUpdateTypes": ["major"],
5+
"addLabels": ["version/major"]
6+
},
7+
{
8+
"matchUpdateTypes": ["minor"],
9+
"addLabels": ["version/minor"]
10+
},
11+
{
12+
"matchUpdateTypes": ["patch"],
13+
"addLabels": ["version/patch"]
14+
},
15+
{
16+
"matchDatasources": ["docker"],
17+
"addLabels": ["renovate/docker"]
18+
},
19+
{
20+
"matchDatasources": ["github-actions", "github-releases", "github-tags"],
21+
"addLabels": ["renovate/github"]
22+
},
23+
{
24+
"matchDatasources": ["helm"],
25+
"addLabels": ["renovate/helm"]
26+
}
27+
]
28+
}

apps/rook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
name = "rook"
55
values = {
6-
"image": {
7-
"tag": "v1.17.7",
8-
},
96
# <https://rook.io/docs/rook/v1.10/CRDs/Cluster/ceph-cluster-crd/?h=stack#network-configuration-settings>
107
"network": {
118
"dualStack": True,
@@ -77,7 +74,10 @@ def objects():
7774
"annotations": {"argocd.argoproj.io/compare-options": "IgnoreExtraneous"},
7875
},
7976
"spec": {
80-
"cephVersion": {"image": "quay.io/ceph/ceph:v19.2.3"},
77+
"cephVersion": {
78+
# renovate source=docker name=quay.io/ceph/ceph
79+
"image": "quay.io/ceph/ceph:v19.2.3"
80+
},
8181
"dataDirHostPath": "/var/lib/rook",
8282
"mon": {"count": 3, "allowMultiplePerNode": False},
8383
# Re-enable this when the issue that blocks it is merged and available in a released Ceph version.

apps/velero.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"initContainers": [
99
{
1010
"name": "velero-plugin-for-csi",
11+
# renovate source=docker name=docker.io/velero/velero-plugin-for-csi
1112
"image": "velero/velero-plugin-for-csi:v0.7.0",
1213
"imagePullPolicy": "IfNotPresent",
1314
"volumeMounts": [
@@ -20,6 +21,7 @@
2021
{
2122
"name": "velero-plugin-for-aws",
2223
# for S3-compatible API
24+
# renovate source=docker name=docker.io/velero/velero-plugin-for-aws
2325
"image": "velero/velero-plugin-for-aws:v1.9.0",
2426
"imagePullPolicy": "IfNotPresent",
2527
"volumeMounts": [

0 commit comments

Comments
 (0)