👷 update renovate config

This commit is contained in:
auricom
2023-11-29 23:48:19 +01:00
parent e27631b969
commit e4f94047bd
6 changed files with 121 additions and 84 deletions

View File

@@ -1,29 +1,29 @@
{
"extends": [
"config:base",
"config:recommended",
"docker:enableMajor",
":disableRateLimiting",
":dependencyDashboard",
":semanticCommits",
":enablePreCommit",
":automergeDigest",
":automergeBranch",
"github>auricom/home-ops//.github/renovate/allowedVersions.json5",
"github>auricom/home-ops//.github/renovate/autoMerge.json5",
"github>auricom/home-ops//.github/renovate/commitMessage.json5",
"github>auricom/home-ops//.github/renovate/customDatasources.json5",
"github>auricom/home-ops//.github/renovate/customManagers.json5",
"github>auricom/home-ops//.github/renovate/groups.json5",
"github>auricom/home-ops//.github/renovate/labels.json5"
"github>auricom/home-ops//.github/renovate/labels.json5",
"github>auricom/home-ops//.github/renovate/packageRules.json5",
"helpers:pinGitHubActionDigests"
],
"platform": "github",
"username": "feisar-bot[bot]",
"repositories": ["auricom/home-ops"],
"assignees": ["auricom"],
"platformCommit": true,
"onboarding": false,
"requireConfig": "optional",
"gitAuthor": "feisar-bot <feisar-bot[bot]@users.noreply.github.com>",
"dependencyDashboardTitle": "Renovate Dashboard 🤖",
"suppressNotifications": ["prIgnoreNotification"],
"rebaseWhen": "conflicted",
"commitBodyTable": true,
"commitMessagePrefix": "⬆️",
"ignorePaths": ["**/archive/**"],
"flux": {
"fileMatch": ["(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"]
},
@@ -36,62 +36,5 @@
"(^|/)ansible/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
]
},
"regexManagers": [
{
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)ansible/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `k3s_release_version: "v1.27.3+k3s1"`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?\"(?<currentValue>.*)\"\n",
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
}
],
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
// setup datasources
{
"matchDatasources": ["helm"],
"ignoreDeprecated": true
},
{
"matchDatasources": ["docker"],
"matchUpdateTypes": ["major", "minor", "patch"],
"commitMessageExtra": "to {{newVersion}}"
},
// custom versioning
{
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["changedetection", "qbittorrent"]
},
{
"matchDatasources": ["docker"],
"matchPackageNames": ["ghcr.io/linuxserver/calibre"],
"versioning": "regex:^version-v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$"
}
]
}

View File

@@ -2,6 +2,7 @@
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"commitMessageTopic": "{{depName}}",
"commitMessageExtra": "to {{newVersion}}",
"commitMessagePrefix": "⬆️",
"commitMessageSuffix": "",
"packageRules": [
{
@@ -11,6 +12,11 @@
{
"matchDatasources": ["docker"],
"commitMessageTopic": "image {{depName}}"
},
{
"matchDatasources": ["custom.grafana-dashboards"],
"commitMessageTopic": "dashboard {{depName}}",
"commitMessageExtra": "to revision {{newVersion}}"
}
]
}

View File

@@ -0,0 +1,12 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
}
}

50
.github/renovate/customManagers.json5 vendored Normal file
View File

@@ -0,0 +1,50 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"customType": "regex",
"description": "Process custom dependencies",
"fileMatch": [
"(^|/)ansible/.+\\.ya?ml(\\.j2)?$",
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
// Example: `k3s_release_version: "v1.27.3+k3s1"`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?\"(?<currentValue>.*)\"\n",
// Example: `- https://github.com/rancher/system-upgrade-controller/releases/download/v0.11.0/crd.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/install.yaml`
// `- https://github.com/argoproj/argo-cd/raw/v2.7.10/manifests/ha/install.yaml`
// `- https://raw.githubusercontent.com/keycloak/keycloak-k8s-resources/21.1.1/kubernetes/kubernetes.yml`
"datasource=(?<datasource>\\S+) depName=(?<depName>\\S+)( versioning=(?<versioning>\\S+))?\n.*?-\\s(.*?)\/(?<currentValue>(v|\\d)[^/]+)\/\\S+\n",
// Example: apiVersion=helm.cattle.io/v1 kind=HelmChart
"datasource=(?<datasource>\\S+)\n.*?repo: (?<registryUrl>\\S+)\n.*?chart: (?<depName>\\S+)\n.*?version: (?<currentValue>\\S+)\n"
],
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}"
},
{
"customType": "regex",
"description": "Process CloudnativePG Postgresql version",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"imageName: (?<depName>\\S+):(?<currentValue>.*\\-.*)"
],
"datasourceTemplate": "docker",
"versioningTemplate": "redhat"
},
{
"customType": "regex",
"description": "Process Grafana dashboards",
"fileMatch": [
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?$"
],
"matchStrings": [
"depName=\"(?<depName>.*)\"\\n\\s+gnetId:\\s+(?<packageName>.*?)\\n\\s+revision:\\s+(?<currentValue>.*)"
],
"datasourceTemplate": "custom.grafana-dashboards",
"versioningTemplate": "regex:^(?<major>\\d+)$"
}
]
}

16
.github/renovate/packageRules.json5 vendored Normal file
View File

@@ -0,0 +1,16 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"packageRules": [
{
"description": "Loose versioning for non-semver packages",
"matchDatasources": ["docker"],
"versioning": "loose",
"matchPackagePatterns": ["qbittorrent"]
},
{
"matchDatasources": ["docker"],
"matchPackageNames": ["ghcr.io/linuxserver/calibre"],
"versioning": "regex:^version-v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$"
}
]
}

View File

@@ -1,50 +1,60 @@
---
name: "Renovate"
on:
workflow_dispatch:
inputs:
dryRun:
description: "Dry-Run"
description: Dry Run
default: "false"
required: false
logLevel:
description: "Log-Level"
default: "debug"
description: Log Level
default: debug
required: false
schedule:
- cron: "0 * * * *"
push:
branches: ["main"]
paths:
- ".github/renovate.json5"
- ".github/renovate/**.json5"
- .github/renovate.json5
- .github/renovate/**.json5
# Retrieve BOT_USER_ID via `curl -s "https://api.github.com/users/${BOT_USERNAME}%5Bbot%5D" | jq .id`
env:
DRY_RUN: false
LOG_LEVEL: debug
RENOVATE_DRY_RUN: false
RENOVATE_CONFIG_FILE: .github/renovate.json5
RENOVATE_ONBOARDING_CONFIG_FILE_NAME: .github/renovate.json5
RENOVATE_AUTODISCOVER: true
RENOVATE_AUTODISCOVER_FILTER: "${{ github.repository }}"
RENOVATE_USERNAME: "${{ secrets.BOT_USERNAME }}[bot]"
RENOVATE_GIT_AUTHOR: "${{ secrets.BOT_USERNAME }} <${{ secrets.BOT_USER_ID }}+${{ secrets.BOT_USERNAME }}[bot]@users.noreply.github.com>"
jobs:
renovate:
name: Renovate
runs-on: ubuntu-latest
steps:
- name: Generate Token
uses: actions/create-github-app-token@e995b4e40ace2eb5bf13137d9abe242c98f3aab6 # v1.6.0
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Generate Token
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0
id: generate-token
with:
app_id: "${{ secrets.BOT_APP_ID }}"
private_key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"
token: "${{ steps.app-token.outputs.token }}"
- name: Override default config from dispatch variables
shell: bash
run: |
echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.RENOVATE_DRY_RUN }}" >> "${GITHUB_ENV}"
echo "RENOVATE_DRY_RUN=${{ github.event.inputs.dryRun || env.DRY_RUN }}" >> "${GITHUB_ENV}"
echo "LOG_LEVEL=${{ github.event.inputs.logLevel || env.LOG_LEVEL }}" >> "${GITHUB_ENV}"
- name: Renovate
uses: renovatebot/github-action@5d3fbef92a76cbf78f5732d17c07a2e76e6f7555 # v39.1.4
with:
configurationFile: "${{ env.RENOVATE_CONFIG_FILE }}"
token: "${{ steps.generate-token.outputs.token }}"
configurationFile: "${{ env.RENOVATE_ONBOARDING_CONFIG_FILE_NAME }}"
token: "${{ steps.app-token.outputs.token }}"