-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add renovatebot to run hourly in a self-hosted github action instead …
…of using dependabot Signed-off-by: jessebot <[email protected]>
- Loading branch information
Showing
6 changed files
with
123 additions
and
17 deletions.
There are no files selected for viewing
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 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"onboarding": false, | ||
"username": "renovate-release", | ||
"gitAuthor": "Renovate Bot <[email protected]>", | ||
"platform": "github", | ||
"repositories": [ | ||
"nextcloud/helm" | ||
] | ||
} |
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,32 @@ | ||
name: Renovate | ||
on: | ||
schedule: | ||
# run hourly | ||
- cron: '0 * * * *' | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- ".github/renovate-config.json" | ||
- ".github/workflows/renovate.yml" | ||
- "renovate.json" | ||
- "scripts/**" | ||
jobs: | ||
renovate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get token | ||
id: get_token | ||
uses: tibdex/[email protected] | ||
with: | ||
private_key: ${{ secrets.PRIVATE_KEY }} | ||
app_id: ${{ secrets.APP_ID }} | ||
|
||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Self-hosted Renovate | ||
uses: renovatebot/[email protected] | ||
with: | ||
token: '${{ steps.get_token.outputs.token }}' | ||
configurationFile: .github/renovate-config.json |
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,50 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"customManagers": [ | ||
{ | ||
"customType": "regex", | ||
"datasourceTemplate": "docker", | ||
"fileMatch": [ | ||
"(^|/)Chart\\.yaml$" | ||
], | ||
"matchStrings": [ | ||
"#\\s*renovate: image=(?<depName>.*?)\\s+appVersion:\\s*[\"']?(?<currentValue>[\\w+\\.\\-]*)" | ||
] | ||
} | ||
], | ||
"packageRules": [ | ||
{ | ||
"description": "Fix subchart archives for helm chart", | ||
"matchManagers": ["helmv3"], | ||
"postUpdateOptions": ["helmUpdateSubChartArchives"] | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep patch updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["patch"], | ||
"bumpVersion": "patch" | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep minor updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["minor"], | ||
"bumpVersion": "minor" | ||
}, | ||
{ | ||
"description": "Fix version in Chart.yaml after helmv3 dep major updates", | ||
"matchManagers": ["helmv3"], | ||
"matchUpdateTypes": ["major"], | ||
"bumpVersion": "major" | ||
}, | ||
{ | ||
"description": "Bump helm chart versions by a patch when updating values files. Digests, pins, rollbacks, replacements and pinDigest updates are deliberately ignored since in our use case, these need a manual decision about the version bump for the chart. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.", | ||
"matchManagers": ["helm-values", "regex"], | ||
"postUpgradeTasks": { | ||
"commands": [ | ||
"bash scripts/bump-chart-version.sh '{{{updateType}}}'" | ||
], | ||
"fileFilters": ["**/Chart.yaml"] | ||
} | ||
} | ||
] | ||
} |
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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
parent_dir="$1" | ||
update_type="$2" | ||
|
||
version=$(grep "^version:" "charts/${parent_dir}/Chart.yaml" | awk '{print $2}') | ||
if [[ ! $version ]]; then | ||
echo "No valid version was found" | ||
exit 1 | ||
fi | ||
|
||
major=$(echo "$version" | cut -d. -f1) | ||
minor=$(echo "$version" | cut -d. -f2) | ||
patch=$(echo "$version" | cut -d. -f3) | ||
|
||
if [[ "$update_type" =~ (major|replacement) ]]; then | ||
major=$(( major + 1 )) | ||
minor=0 | ||
patch=0 | ||
elif [[ "$update_type" =~ 'minor' ]]; then | ||
minor=$(( minor + 1 )) | ||
patch=0 | ||
else | ||
patch=$(( patch + 1 )) | ||
fi | ||
|
||
echo "Bumping version for $parent_dir from $version to $major.$minor.$patch" | ||
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/${parent_dir}/Chart.yaml" |