generated from argoproj-labs/applicationset-hello-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
7 changed files
with
154 additions
and
14 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,11 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"onboarding": false, | ||
"username": "renovate-release", | ||
"gitAuthor": "Renovate Bot <bot@renovateapp.com>", | ||
"platform": "github", | ||
"repositories": [ | ||
"small-hack/appset-secret-plugin" | ||
], | ||
"allowedPostUpgradeCommands": ["^scripts"] | ||
} |
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,26 @@ | ||
name: Generate helm docs | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'charts/matrix/**' | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-docs: | ||
name: update-docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- name: Render helm docs inside the README.md and push changes back to PR branch | ||
uses: netfoundry/helm-docs-action@v1 | ||
with: | ||
working-dir: charts/matrix | ||
git-push: "true" |
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,33 @@ | ||
name: Renovate | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
# This should be every hour | ||
- 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: app-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
private-key: ${{ secrets.PRIVATE_KEY }} | ||
app-id: ${{ secrets.APP_ID }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4.1.7 | ||
|
||
- name: Self-hosted Renovate | ||
uses: renovatebot/github-action@v40.1.12 | ||
with: | ||
token: '${{ steps.app-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
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,15 +1,54 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:base" | ||
], | ||
"regexManagers": [ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": [ | ||
"config:recommended", ":disableDependencyDashboard" | ||
], | ||
"customManagers": [ | ||
{ | ||
"fileMatch": ["(^|/)Chart\\.yaml$"], | ||
"matchStrings": [ | ||
"#\\s?renovate: image=(?<depName>.*?)\\s?appVersion:\\s?\\\"?(?<currentValue>[\\w+\\.\\-]*)", | ||
], | ||
"datasourceTemplate": "docker" | ||
}, | ||
"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. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.", | ||
"matchManagers": ["helm-values", "regex"], | ||
"postUpgradeTasks": { | ||
"commands": [ | ||
"scripts/bump-chart-version.sh '{{{updateType}}}'" | ||
], | ||
"fileFilters": ["**/Chart.yaml"], | ||
"executionMode": "branch" | ||
} | ||
} | ||
] | ||
} |
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,31 @@ | ||
#!/usr/bin/env bash | ||
# thanks to original comment: https://github.com/renovatebot/renovate/issues/8231#issuecomment-1978929997 | ||
# converted to discussion: https://github.com/renovatebot/renovate/discussions/28861#discussioncomment-9326722 | ||
|
||
set -euo pipefail | ||
|
||
update_type="$1" | ||
version=$(grep "^version:" "./charts/appset-secret-plugin/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 appset-secret-plugin chart from $version to $major.$minor.$patch" | ||
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/appset-secret-plugin/Chart.yaml" |