Skip to content

Commit

Permalink
Update renovate-with-renovate.md
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-hermann-sva authored Nov 17, 2024
1 parent 420b7cb commit c68a8b0
Showing 1 changed file with 38 additions and 43 deletions.
81 changes: 38 additions & 43 deletions renovate-with-renovate.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,45 @@ docker run --rm -v "$(pwd):/usr/src/app" renovate/renovate
```
## Custom Dependency Updates
## Define Custom Dependency Updates
[//]: # (Add sthings ansible example)
For specialized dependencies update rules (which may not fit standard update workflows) the renoate concepts customManagers and customDatasources can be used.
In the following (shortend) example we want to get updates from github releases for an ansible playbook which can be used for installing binaries. the comment after the version is used as a marker for renovate for inserting an version update in the given structure/variable.
```
vars:
- name: tools
file: |
---
kind_version: 0.25.0 # datasource=github-tags depName=kubernetes-sigs/kind
skopeo_version: 1.14.4 # datasource=github-tags depName=lework/skopeo-binary
helm_version: 3.16.2 # datasource=github-tags depName=helm/helm
kubectl_version: v1.30.2 # datasource=github-tags depName=kubernetes/kubectl
k9s_version: v0.32.5 # datasource=github-tags depName=kubernetes/kubectl
velero_version: 1.15.0 # datasource=github-tags depName=vmware-tanzu/velero
kubectl_slice_version: 1.4.0 # datasource=github-tags depName=patrickdappollonio/kubectl-slice
helmfile_version: 0.169.1 # datasource=github-tags depName=helmfile/helmfile
argocd_version: 2.13.0 # datasource=github-tags depName=argoproj/argo-cd
flux_version: 2.4.0 # datasource=github-tags depName=fluxcd/flux2
glab_version: 1.48.0 # datasource=gitlab-tags depName=gitlab-org/cli
cilium_version: 0.16.19 # datasource=gitlab-tags depName=cilium/cilium-cli
dagger_version: 0.13.3 # datasource=gitlab-tags depName=dagger/dagger
bin:
flux:
bin_name: flux
bin_version: "{{ flux_version }}"
check_bin_version_before_installing: true
source_url: "https://github.com/fluxcd/flux2/releases/download/v{{ flux_version }}/flux_{{ flux_version }}_linux_amd64.tar.gz"
bin_to_copy: flux
to_remove: ""
bin_dir: "/usr/bin/flux"
version_cmd: "version"
target_version: "{{ flux_version }}"
```
the following configuration shows how a regex based customManager for the custom ansible format can be defined. the customDatasource is used for getting updates from hashicorp releases (which will be published on their api).
```bash
cat <<EOF > renovate.json
Expand All @@ -159,17 +195,6 @@ cat <<EOF > renovate.json
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"depNameTemplate": "{{#if depName}}{{{depName}}}{{else}}{{{binName}}}{{/if}}"
},
{
"customType": "regex",
"fileMatch": ["^Dockerfile$"],
"matchStrings": [
"\\s*(?<binName>.+)_version:\\s(?<currentValue>v?\\d+\\.\\d+\\.\\d+)\\s*#\\s*(datasource=(?<datasource>[^\\s]*))\\s*(depName=(?<depName>[^\\s]*))?\\s*"
],
"versioningTemplate": "{{#if versioning}}{{{versioning}}}{{else}}semver{{/if}}",
"extractVersionTemplate": "^v?(?<version>.*)$",
"datasourceTemplate": "{{#if datasource}}{{{datasource}}}{{else}}github-releases{{/if}}",
"depNameTemplate": "{{#if depName}}{{{depName}}}{{else}}{{{binName}}}{{/if}}"
}
],
"customDatasources": {
"hashicorp": {
Expand All @@ -183,37 +208,7 @@ cat <<EOF > renovate.json
EOF
```
```
vars:
- name: tools
file: |
---
kind_version: 0.25.0 # datasource=github-tags depName=kubernetes-sigs/kind
skopeo_version: 1.14.4 # datasource=github-tags depName=lework/skopeo-binary
helm_version: 3.16.2 # datasource=github-tags depName=helm/helm
kubectl_version: v1.30.2 # datasource=github-tags depName=kubernetes/kubectl
k9s_version: v0.32.5 # datasource=github-tags depName=kubernetes/kubectl
velero_version: 1.15.0 # datasource=github-tags depName=vmware-tanzu/velero
kubectl_slice_version: 1.4.0 # datasource=github-tags depName=patrickdappollonio/kubectl-slice
helmfile_version: 0.169.1 # datasource=github-tags depName=helmfile/helmfile
argocd_version: 2.13.0 # datasource=github-tags depName=argoproj/argo-cd
flux_version: 2.4.0 # datasource=github-tags depName=fluxcd/flux2
glab_version: 1.48.0 # datasource=gitlab-tags depName=gitlab-org/cli
cilium_version: 0.16.19 # datasource=gitlab-tags depName=cilium/cilium-cli
dagger_version: 0.13.3 # datasource=gitlab-tags depName=dagger/dagger
bin:
flux:
bin_name: flux
bin_version: "{{ flux_version }}"
check_bin_version_before_installing: true
source_url: "https://github.com/fluxcd/flux2/releases/download/v{{ flux_version }}/flux_{{ flux_version }}_linux_amd64.tar.gz"
bin_to_copy: flux
to_remove: ""
bin_dir: "/usr/bin/flux"
version_cmd: "version"
target_version: "{{ flux_version }}"
```
## GitHub Integration
Expand Down

0 comments on commit c68a8b0

Please sign in to comment.