Skip to content

Commit

Permalink
feat: split and enhance renovate config
Browse files Browse the repository at this point in the history
  • Loading branch information
M0NsTeRRR committed Jun 21, 2024
1 parent 9af288c commit 1d8b3f0
Show file tree
Hide file tree
Showing 36 changed files with 534 additions and 323 deletions.
314 changes: 22 additions & 292 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -1,298 +1,28 @@
{
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
extends: [
'config:base',
':dependencyDashboard',
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
"docker:enableMajor",
"replacements:k8s-registry-move",
":automergeBranch",
":disableRateLimiting",
":dependencyDashboard",
":semanticCommits",
":skipStatusChecks",
":timezone(Europe/Paris)",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/ansible.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/autoMerge.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/grafanaDashboards.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/labels.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/packer.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/semanticCommits.json5",
"github>M0NsTeRRR/homelabv3-infra//.github/renovate/terraform.json5"
],
dependencyDashboardAutoclose: true,
automergeType: 'pr',
platformAutomerge: true,
rebaseWhen: 'conflicted',
"timezone": "Europe/Paris",
"rebaseWhen": "conflicted",
"schedule": [
"before 9pm on friday"
],
prConcurrentLimit: 0,
prHourlyLimit: 0,
terragrunt: {
enabled: false
},
labels: [
'dependencies',
],
vulnerabilityAlerts: {
enabled: true,
labels: [
'security',
],
},
patch: {
automerge: true,
},
pin: {
automerge: true,
},
customManagers: [
// VSCode devcontainer.json features version
{
customType: "regex",
fileMatch: ["devcontainer.json$"],
matchStrings: ['datasource=(?<datasource>\\S*)[\\s]+depName=(?<depName>\\S*)[\\s]+"\\w+":[\\s]+"(?<currentValue>[a-zA-Z0-9-_.]+)"'],
versioningTemplate: 'regex:^v(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?-?(?<compatibility>\\S+)?$',
},
// grafana dashboards
{
customType: "regex",
fileMatch: ["\\.ya?ml$"],
matchStrings: [
"(?<depName>\\S*):\n(?<indentation>\\s+)gnetId:\\s+(?<packageName>\\S*)\n\\s+revision:\\s+(?<currentValue>\\S*)",
"(?<depName>\\S*):\n(?<indentation>\\s+)revision:\\s+(?<currentValue>\\S*)\n\\s+gnetId:\\s+(?<packageName>\\S*)"
],
autoReplaceStringTemplate: "{{{depName}}}:\n{{{indentation}}}gnetId: {{{packageName}}}\n{{{indentation}}}revision: {{{newValue}}}",
versioningTemplate: "regex:^(?<major>\\d+)$",
datasourceTemplate: "custom.grafana-dashboards"
},
// match packer and plugin version
{
customType: "regex",
fileMatch: [
'\\.pkr\\.hcl',
],
matchStrings: [
'required_version[\\s]+=[\\s]+"=?(?<currentValue>\\S*)"',
'source[\\s]+=[\\s]+"github.com/(?<depName>\\S*)"[\\s]+version[\\s]+=[\\s]+"(?<currentValue>\\S*)"',
'version[\\s]+=[\\s]+"(?<currentValue>\\S*)[\\s]+source[\\s]+=[\\s]+"github.com/(?<depName>\\S*)"',
],
datasourceTemplate: 'github-tags',
depNameTemplate: '{{#if depName}}{{#if (containsString depName "hashicorp/")}}{{{replace "hashicorp/" "hashicorp/packer-plugin-" depName}}}{{else}}{{{depName}}}{{/if}}{{else}}hashicorp/packer{{/if}}',
},
// match distribution version
{
customType: "regex",
fileMatch: [
'\\.pkr\\.hcl',
],
matchStrings: [
'(distribution).+\r?\n.+\r?\n.+"(?<depName>\\S*)"[\\S\\s]+(version).+\r?\n.+\r?\n.+"(?<currentValue>\\S*)"',
'(version).+\r?\n.+\r?\n.+"(?<currentValue>\\S*)"[\\S\\s]+(distribution).+\r?\n.+\r?\n.+"(?<depName>\\S*)"'
],
datasourceTemplate: 'docker',
},
// match terraform and terragrunt version
{
customType: "regex",
fileMatch: [
'(^|/)terragrunt\\.hcl$',
],
matchStrings: [
'(?<depName>\\S*)_version_constraint\\s+=\\s+"(?<currentValue>\\S*)"',
],
datasourceTemplate: 'github-tags',
depNameTemplate: '{{#if (containsString depName "terragrunt")}}gruntwork-io/terragrunt{{else}}hashicorp/terraform{{/if}}',
},
// match terraform plugin version
{
customType: "regex",
fileMatch: [
'(^|/)terragrunt\\.hcl$',
],
matchStrings: [
'source[\\s]+=[\\s]+"(?<depName>\\S*)"[\\s]+version[\\s]+=[\\s]+"=?(?<currentValue>\\S*)"',
'version[\\s]+=[\\s]+"=?(?<currentValue>\\S*)"[\\s]+source[\\s]+=[\\s]+"(?<depName>\\S*)"[\\s]',
],
datasourceTemplate: 'terraform-provider',
},
// match min_ansible_version in ansible role meta
{
customType: "regex",
fileMatch: [
'(^|/)roles\\S+meta/\\S+\\.ya?ml',
],
matchStrings: [
'min_ansible_version:\\s+"(?<currentValue>\\S*)"',
],
depNameTemplate: 'ansible-core',
datasourceTemplate: 'pypi',
},
// match program version in ansible defaults
{
customType: "regex",
fileMatch: [
'(^|/)roles\\S+defaults/\\S+\\.ya?ml',
],
matchStrings: [
'datasource=(?<datasource>\\S*)[\\s]+depName=(?<depName>\\S*)([\\s]+registryUrl=(?<registryUrl>\\S*))?\r?\n[\\S]+\\s"?(?<currentValue>[a-zA-Z0-9-_.+]+)"?',
],
},
// match github yaml in kustomization file
{
customType: "regex",
fileMatch: [
"(^|/)kustomization.ya?ml$"
],
matchStrings: [
"https:\/\/raw\\.githubusercontent\\.com\/(?<depName>[^\/]*\/[^\/]*)\/(?<currentValue>.*?)\/",
"https:\/\/github\\.com\/(?<depName>[^\/]*\/[^\/]*)\/releases\/download\/.*(?<currentValue>\\d+.\\d+.\\d+)\/"
],
datasourceTemplate: "github-tags",
},
],
packageRules: [
// group ansible version in one PR
{
matchDatasources: [
'pypi',
],
matchDepPatterns: [
'ansible/ansible',
'ansible-core',
'ansible/ansible-lint'
],
groupName: 'ansible version',
},
// match github yaml in kustomization file
{
matchFileNames: [
"**/kustomization.yaml",
"**/kustomization.yml",
],
matchDatasources: ["github-tags"],
versioning: 'regex:^v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)',
},
// handle packer, packer plugin, terraform, terragrunt versions (not terraform modules) to add "v" char in front of semver
{
matchPackageNames: [
'gruntwork-io/terragrunt',
'hashicorp/terraform',
'hashicorp/packer',
],
matchPackagePatterns: [
'^hashicorp/packer-plugin-'
],
matchDepNames: [
'gruntwork-io/terragrunt',
'hashicorp/terraform',
'hashicorp/packer',
],
matchDepPatterns: [
'^hashicorp/packer-plugin-'
],
versioning: 'regex:^v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)',
},
// handle k3s github tag that don't follow semver
{
matchPackageNames: [
'k3s-io/k3s',
],
matchDepNames: [
'k3s-io/k3s',
],
ignoreUnstable: false,
versioning: 'regex:^v?(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)(?<compatibility>\\+k3s)(?<build>\\d+)',
},
// handle external-dns github tag that don't follow semver
{
matchPackageNames: [
'kubernetes-sigs/external-dns',
],
matchDepNames: [
'kubernetes-sigs/external-dns',
],
matchCurrentValue: '/^external-dns-helm-chart/',
versioning: 'regex:^external-dns-helm-chart-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)',
},
// handle scaleway-certmanager-webhook github tag that don't follow semver
{
matchPackageNames: [
'scaleway/helm-charts',
],
matchDepNames: [
'scaleway/helm-charts',
],
matchCurrentValue: '/^scaleway-certmanager-webhook/',
versioning: 'regex:^scaleway-certmanager-webhook-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)',
},
// handle argo-cd helm github tag that don't follow semver
{
matchPackageNames: [
'argoproj/argo-helm',
],
matchDepNames: [
'argoproj/argo-helm',
],
versioning: 'regex:^argo-cd-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)',
},
// handle prometheus operator tag that don't follow semver
{
matchPackageNames: [
'prometheus-community/helm-charts',
],
matchDepNames: [
'prometheus-community/helm-charts',
],
versioning: 'regex:^prometheus-operator-crds-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$',
},
// handle kubectl tag that don't follow semver
{
matchPackageNames: [
'kubernetes/kubectl',
],
matchDepNames: [
'kubernetes/kubectl',
],
versioning: 'regex:^kubernetes-(?<major>\\d+)\\.(?<minor>\\d+)\\.(?<patch>\\d+)$',
},
// handle pdns auth github tag that don't follow semver
{
matchPackageNames: [
'PowerDNS/pdns',
],
matchDepNames: [
'PowerDNS/pdns',
],
matchCurrentValue: '/^auth/',
versioning: 'regex:^auth-(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?-?(?<compatibility>\\S+)?$',
},
// handle pdns rec github tag that don't follow semver
{
matchPackageNames: [
'PowerDNS/pdns',
],
matchDepNames: [
'PowerDNS/pdns',
],
matchCurrentValue: '/^rec/',
versioning: 'regex:^rec-(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?-?(?<compatibility>\\S+)?$',
},
// handle pdns dnsdist github tag that don't follow semver
{
matchPackageNames: [
'PowerDNS/pdns',
],
matchDepNames: [
'PowerDNS/pdns',
],
matchCurrentValue: '/^dnsdist/',
versioning: 'regex:^dnsdist-(?<major>\\d+)\\.(?<minor>\\d+)\\.?(?<patch>\\d+)?-?(?<compatibility>\\S+)?$',
},
// handle kea dhcp tag that don't follow semver
{
matchPackageNames: [
'projects/kea',
],
matchDepNames: [
'projects/kea',
],
versioning: 'regex:^Kea-(?<major>\\d+)\\.(?<minor>\\d+)(\\.(\\d+))?$',
},
],
"customDatasources": {
"grafana-dashboards": {
"defaultRegistryUrlTemplate": "https://grafana.com/api/dashboards/{{packageName}}",
"format": "json",
"transformTemplates": [
"{\"releases\":[{\"version\": $string(revision)}]}"
]
}
}
"labels": [
"dependencies",
]
}
Loading

0 comments on commit 1d8b3f0

Please sign in to comment.