feat(github): Support redis and extension-installer in Renovate - alternative (#3143)

This commit is contained in:
Marco Maurer (-Kilchhofer) 2025-01-28 06:51:33 +01:00 committed by GitHub
parent c2f3d9967d
commit 692bd040ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 33 deletions

View file

@ -32,6 +32,7 @@ jobs:
# renovate: datasource=docker depName=ghcr.io/renovatebot/renovate # renovate: datasource=docker depName=ghcr.io/renovatebot/renovate
renovate-version: 39.86.4 renovate-version: 39.86.4
token: '${{ steps.get_token.outputs.token }}' token: '${{ steps.get_token.outputs.token }}'
mount-docker-socket: true
env: env:
LOG_LEVEL: 'debug' LOG_LEVEL: 'debug'
RENOVATE_REPOSITORIES: '${{ github.repository }}' RENOVATE_REPOSITORIES: '${{ github.repository }}'

View file

@ -83,31 +83,24 @@
"argoproj/argo-workflows", "argoproj/argo-workflows",
"argoproj/argo-cd", "argoproj/argo-cd",
"argoproj/argo-events", "argoproj/argo-events",
"argoproj/argo-rollouts" "argoproj/argo-rollouts",
"argoproj-labs/argocd-image-updater",
"argoprojlabs/argocd-extension-installer",
"public.ecr.aws/bitnami/redis-exporter",
"public.ecr.aws/docker/library/redis"
], ],
"commitMessagePrefix": "chore({{{replace 'argoproj/' '' depName}}}):", "commitMessagePrefix": "chore({{parentDir}}):",
"postUpgradeTasks": { "postUpgradeTasks": {
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"] "commands": [
} "./scripts/renovate-bump-version.sh -c {{parentDir}} -d {{depName}} -v {{newVersion}}",
}, "./scripts/helm-docs.sh"
{ ]
"matchPackagePatterns": ["argoproj-labs/argocd-image-updater"],
"commitMessagePrefix": "chore({{{replace 'argoproj-labs/' '' depName}}}):",
"postUpgradeTasks": {
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"]
} }
}, },
{ {
"matchPackagePatterns": ["redis-ha"], "matchPackagePatterns": ["redis-ha"],
"enabled": false "enabled": false
}, },
{
"matchPackagePatterns": ["public.ecr.aws/bitnami/redis-exporter"],
"commitMessagePrefix": "chore({{{replace 'public.ecr.aws/' '' depName}}}):",
"postUpgradeTasks": {
"commands": ["./scripts/renovate-bump-version.sh {{depName}}"]
}
},
{ {
"matchPackageNames": ["ghcr.io/renovatebot/renovate"], "matchPackageNames": ["ghcr.io/renovatebot/renovate"],
"extends": ["schedule:monthly"] "extends": ["schedule:monthly"]

View file

@ -1,31 +1,41 @@
#!/bin/bash #!/bin/bash
depName="${1}" while getopts c:d:v: opt; do
if [ -z "${depName}" ]; then case ${opt} in
echo "Missing argument 'depName'" >&2 c) chart=${OPTARG} ;;
echo "Example usage: $0 argoproj/argo-cd" >&2 d) dependency_name=${OPTARG} ;;
v) dependency_version=${OPTARG} ;;
*)
echo 'Usage:' >&2
echo '-c: chart Related Helm chart name' >&2
echo '-d dependency Name of the updated dependency' >&2
echo '-v version New version of the updated dependency' >&2
exit 1
esac
done
if [ -z "${dependency_name}" ] || [ -z "${dependency_version}" ] || [ -z "${chart}" ] ; then
echo 'Missing relevant CLI flag(s).' >&2
exit 1 exit 1
fi fi
chartName=$(echo "$depName" | sed -e "s+^argoproj/++" -e "s+^argoproj-labs/++") chart_yaml_path="charts/${chart}/Chart.yaml"
echo "Changed chart name is: $chartName" # Split dependency by '/' and only use last element
echo "----------------------------------------" # This way we can drop prefixes like "argoproj/..." , "argoproj-labs/..." , "quay.io/foo/..."
dependency_name="${dependency_name##*/}"
parentDir="charts/${chartName}"
# Bump the chart version by one patch version # Bump the chart version by one patch version
version=$(grep '^version:' "${parentDir}/Chart.yaml" | awk '{print $2}') version=$(grep '^version:' "${chart_yaml_path}" | awk '{print $2}')
major=$(echo "${version}" | cut -d. -f1) major=$(echo "${version}" | cut -d. -f1)
minor=$(echo "${version}" | cut -d. -f2) minor=$(echo "${version}" | cut -d. -f2)
patch=$(echo "${version}" | cut -d. -f3) patch=$(echo "${version}" | cut -d. -f3)
patch=$((patch + 1)) patch=$((patch + 1))
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "${parentDir}/Chart.yaml" sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "${chart_yaml_path}"
# Add a changelog entry # Add a changelog entry
appVersion=$(grep '^appVersion:' "${parentDir}/Chart.yaml" | awk '{print $2}') sed -i -e '/^ artifacthub.io\/changes: |/,$ d' "${chart_yaml_path}"
sed -i -e '/^ artifacthub.io\/changes: |/,$ d' "${parentDir}/Chart.yaml"
{ {
echo " artifacthub.io/changes: |" echo " artifacthub.io/changes: |"
echo " - kind: changed" echo " - kind: changed"
echo " description: Bump ${chartName} to ${appVersion}" echo " description: Bump ${dependency_name} to ${dependency_version}"
} >> "${parentDir}/Chart.yaml" } >> "${chart_yaml_path}"
cat "${parentDir}/Chart.yaml" cat "${chart_yaml_path}"