Skip to content

Commit

Permalink
chore: added "self-hosted" renovate
Browse files Browse the repository at this point in the history
Signed-off-by: kvanzuijlen <[email protected]>
  • Loading branch information
kvanzuijlen committed Mar 12, 2024
1 parent ad97e7d commit 09a94f3
Show file tree
Hide file tree
Showing 21 changed files with 254 additions and 26 deletions.
23 changes: 0 additions & 23 deletions .github/renovate.json

This file was deleted.

177 changes: 177 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
$schema: "https://docs.renovatebot.com/renovate-schema.json",
extends: [ "config:recommended" ],
ignorePaths: [
"charts/enterprise-logs-simple/",
"charts/enterprise-metrics/",
"charts/lgtm-distributed/", // TODO: needs some more work
"charts/loki-stack/" // TODO: needs some more work
],
packageRules: [
{
matchFileNames: [
"charts/agent-operator/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/agent-operator/Chart.yaml"',
],
fileFilters: ["charts/agent-operator/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/enterprise-logs/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/enterprise-logs/Chart.yaml"',
],
fileFilters: ["charts/enterprise-logs/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/fluent-bit/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/fluent-bit/Chart.yaml"',
],
fileFilters: ["charts/grafana/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/grafana/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/grafana/Chart.yaml"',
],
fileFilters: ["charts/grafana/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/loki-canary/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/loki-canary/Chart.yaml"',
],
fileFilters: ["charts/loki-canary/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/loki-distributed/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/loki-distributed/Chart.yaml"',
],
fileFilters: ["charts/loki-distributed/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/promtail/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/promtail/Chart.yaml"',
],
fileFilters: ["charts/promtail/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/rollout-operator/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/rollout-operator/Chart.yaml"',
],
fileFilters: ["charts/rollout-operator/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/synthetic-monitoring-agent/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/synthetic-monitoring-agent/Chart.yaml"',
],
fileFilters: ["charts/synthetic-monitoring-agent/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/tempo/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/tempo/Chart.yaml"',
],
fileFilters: ["charts/tempo/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/tempo-distributed/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/tempo-distributed/Chart.yaml"',
],
fileFilters: ["charts/tempo-distributed/**"],
executionMode: "branch",
},
},
{
matchFileNames: [
"charts/tempo-vulture/",
],
postUpgradeTasks: {
commands: [
'.github/renovate/postupgrade.sh "charts/tempo-vulture/Chart.yaml"',
],
fileFilters: ["charts/tempo-vulture/**"],
executionMode: "branch",
},
}
],
customManagers: [
{
customType: "regex",
fileMatch: [
"(^|/)\\.github/workflows/.+\\.ya?ml$",
"(^|/)\\.github/.+\\.sh$",
],
matchStrings: [
"# renovate: datasource=(?<datasource>[\\w-]+?) depName=(?<depName>[\\w\\/-]+?)( packageName=(?<packageName>.+?))?( extractVersion=(?<extractVersion>.+?))?\\s+?(default|\\w+_VERSION|.*version): (?<currentValue>.*)\\s",
],
},
{
customType: "regex",
fileMatch: [
"Chart.yaml$",
],
matchStrings: [
"# renovate: datasource=(?<datasource>[\\w-]+?) depName=(?<depName>[\\w\\/\\.-]+?)( extractVersion=(?<extractVersion>.+?))?( versioning=(?<versioning>.+?))?\\s+?appVersion: \"?(?<currentValue>.*?)\"?\\s",
],
},
],
}
17 changes: 17 additions & 0 deletions .github/renovate/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# renovate: datasource=github-tags depName=mikefarah/yq
export YQ_VERSION=v4.40.5

# renovate: datasource=github-tags depName=jenkins-x-plugins/jx-release-version
export JENKINS_JX_VERSION=v2.7.3

curl -fsSL -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
chmod a+x /usr/local/bin/yq

curl -fsSL -o /tmp/jx-release.tar.gz https://github.com/jenkins-x-plugins/jx-release-version/releases/download/${JENKINS_JX_VERSION}/jx-release-version-linux-amd64.tar.gz
mkdir -p /tmp/jx && tar -xf /tmp/jx-release.tar.gz -C /tmp/jx
mv /tmp/jx/jx-release-version /usr/local/bin/jx-release-version
chmod a+x /usr/local/bin/jx-release-version

runuser -u ubuntu renovate
6 changes: 6 additions & 0 deletions .github/renovate/postupgrade.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

CHARTVERSION=$(jx-release-version -previous-version=from-file:"$1")
export CHARTVERSION

yq eval '.version = env(CHARTVERSION)' -i "$1"
3 changes: 2 additions & 1 deletion .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
type: boolean
helm_version:
description: version of the helm binary
# renovate: datasource=github-tags depName=helm/helm
# renovate: datasource=github-tags depName=helm packageName=helm/helm
default: v3.8.2
required: false
type: string
Expand Down Expand Up @@ -50,6 +50,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
# renovate: datasource=docker depName=python
python-version: 3.7

- name: Set up chart-testing
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Helm
uses: azure/[email protected]
with:
# renovate: datasource=github-tags depName=helm/helm
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.12.0

- name: Add dependency chart repos
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/renovate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Renovate
on:
schedule:
- cron: "0/15 * * * *"
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Create a GitHub App installation access token
uses: tibdex/github-app-token@v2
id: app-token
with:
app_id: ${{ secrets.github_app_id }}
private_key: ${{ secrets.github_app_pem }}

- name: Checkout
uses: actions/checkout@v4

- name: Self-hosted Renovate
uses: renovatebot/[email protected]
with:
token: "${{ steps.app-token.outputs.token }}"
docker-cmd-file: .github/renovate/entrypoint.sh
docker-user: root
env:
LOG_LEVEL: 'debug'
RENOVATE_REPOSITORIES: ${{ env.GITHUB_REPOSITORY }}
RENOVATE_PLATFORM: github

RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '["^\.github\/renovate-postupgrade\.sh \"charts/[\w-]+/Chart.yaml\"$"]'
RENOVATE_ALLOW_POST_UPGRADE_COMMAND_TEMPLATING: true
2 changes: 1 addition & 1 deletion .github/workflows/update-helm-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v1
with:
# renovate: datasource=github-tags depName=helm/helm
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.5.2

- name: Add dependency chart repos
Expand Down
1 change: 1 addition & 0 deletions charts/agent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: grafana-agent-operator
description: A Helm chart for Grafana Agent Operator
type: application
version: 0.3.18
# renovate: datasource=docker depName=docker.io/grafana/agent-operator
appVersion: "0.40.2"
home: https://grafana.com/docs/agent/v0.40/
icon: https://raw.githubusercontent.com/grafana/agent/v0.40.0/docs/sources/assets/logo_and_name.png
Expand Down
1 change: 1 addition & 0 deletions charts/enterprise-logs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: "v2"
name: "enterprise-logs"
type: application
version: "2.5.0"
# renovate: datasource=docker depName=docker.io/grafana/enterprise-logs
appVersion: "v1.5.2"
kubeVersion: "^1.10.0-0"
description: "Grafana Enterprise Logs"
Expand Down
1 change: 1 addition & 0 deletions charts/fluent-bit/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: "v1"
name: fluent-bit
version: 2.6.0
# renovate: datasource=docker depName=grafana/fluent-bit-plugin-loki
appVersion: v2.1.0
kubeVersion: "^1.10.0-0"
description: "Uses fluent-bit Loki go plugin for gathering logs and sending them to Loki"
Expand Down
1 change: 1 addition & 0 deletions charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v2
name: grafana
version: 7.3.6
# renovate: datasource=docker depName=docker.io/grafana/grafana
appVersion: 10.3.3
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
1 change: 1 addition & 0 deletions charts/loki-canary/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v2
name: loki-canary
description: Helm chart for Grafana Loki Canary
type: application
# renovate: datasource=docker depName=docker.io/grafana/loki
appVersion: 2.9.1
version: 0.14.0
home: https://github.com/grafana/helm-charts
Expand Down
1 change: 1 addition & 0 deletions charts/loki-distributed/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v2
name: loki-distributed
description: Helm chart for Grafana Loki in microservices mode
type: application
# renovate: datasource=docker depName=docker.io/grafana/loki-canary
appVersion: 2.9.4
version: 0.78.3
home: https://grafana.github.io/helm-charts
Expand Down
1 change: 1 addition & 0 deletions charts/promtail/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v2
name: promtail
description: Promtail is an agent which ships the contents of local logs to a Loki instance
type: application
# renovate: datasource=docker depName=docker.io/grafana/promtail
appVersion: 2.9.3
version: 6.15.5
home: https://grafana.com/loki
Expand Down
1 change: 1 addition & 0 deletions charts/rollout-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: rollout-operator
description: "Grafana rollout-operator"
type: application
version: 0.14.0
# renovate: datasource=docker depName=docker.io/grafana/rollout-operator
appVersion: v0.13.0
home: https://github.com/grafana/rollout-operator
kubeVersion: ^1.10.0-0
1 change: 1 addition & 0 deletions charts/snyk-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v2
name: snyk-exporter
description: Prometheus exporter for Snyk.
version: 0.1.0
# renovate: datasource=docker depName=docker.io/grafana/snyk_exporter
appVersion: v1.4.1
home: https://github.com/grafana/snyk_exporter
icon: https://res.cloudinary.com/snyk/image/upload/v1537346326/press-kit/brand/avatar.png
Expand Down
1 change: 1 addition & 0 deletions charts/synthetic-monitoring-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apiVersion: v2
# renovate: datasource=docker depName=docker.io/grafana/synthetic-monitoring-agent versioning=regex:^v(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(-(?<build>\d+)-(?<revision>.*))?$
appVersion: v0.9.3-0-gcd7aadd
description: Grafana's Synthetic Monitoring application. The agent provides probe functionality and executes network checks for monitoring remote targets.
home: https://grafana.net
Expand Down
1 change: 1 addition & 0 deletions charts/tempo-distributed/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: tempo-distributed
description: Grafana Tempo in MicroService mode
type: application
version: 1.8.5
# renovate: datasource=docker depName=docker.io/grafana/tempo
appVersion: 2.3.1
engine: gotpl
home: https://grafana.com/docs/tempo/latest/
Expand Down
1 change: 1 addition & 0 deletions charts/tempo-vulture/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: tempo-vulture
description: Grafana Tempo Vulture - A tool to monitor Tempo performance.
type: application
version: 0.4.1
# renovate: datasource=docker depName=docker.io/grafana/tempo-vulture
appVersion: 2.2.3
engine: gotpl
home: https://grafana.com/docs/tempo/latest/
Expand Down
Loading

0 comments on commit 09a94f3

Please sign in to comment.