Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Introduced Renovate (WIP) #3015

Closed
wants to merge 14 commits into from
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", ":gitSignOff" ],
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",
],
},
],
}
25 changes: 25 additions & 0 deletions .github/renovate/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/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

# renovate: datasource=github-releases depName=helm-docs packageName=norwoodj/helm-docs
export HELM_DOCS_VERSION=1.13.1

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

curl -fsSL -o /tmp/helm-docs.tar.gz https://github.com/norwoodj/helm-docs/releases/download/v"${HELM_DOCS_VERSION}"/helm-docs_"${HELM_DOCS_VERSION}"_Linux_x86_64.tar.gz
mkdir -p /tmp/helm-docs && tar -xf /tmp/helm-docs.tar.gz -C /tmp/helm-docs
mv /tmp/helm-docs/helm-docs /usr/local/bin/helm-docs
chmod a+x /usr/local/bin/helm-docs

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

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

yq eval '.version = env(CHARTVERSION)' -i "$1"
helm-docs
2 changes: 2 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
type: boolean
helm_version:
description: version of the helm binary
# renovate: datasource=github-tags depName=helm packageName=helm/helm
default: v3.8.2
required: false
type: string
Expand Down Expand Up @@ -49,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
10 changes: 8 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,23 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Check Docs
env:
# renovate: datasource=docker depName=jnorwood/helm-docs
HELM_DOCS_VERSION: v1.8.1
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.8.1
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:${{ env.HELM_DOCS_VERSION }}
if ! git diff --exit-code; then
echo "Documentation not up to date. Please run helm-docs and commit changes!" >&2
exit 1
fi

- name: Lint Code Base
uses: docker://github/super-linter:v3.12.0
uses: super-linter/super-linter@v4.0.2
env:
FILTER_REGEX_EXCLUDE: .*(README\.md|Chart\.yaml|NOTES.txt).*
FILTER_REGEX_INCLUDE: ${{ inputs.filter_regex_include }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- name: Set up Helm
uses: azure/[email protected]
with:
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.12.0

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

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: '["${{ 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
RENOVATE_PR_HOURLY_LIMIT: 10
RENOVATE_PR_CONCURRENT_LIMIT: 10
5 changes: 4 additions & 1 deletion .github/workflows/update-helm-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ env:
CR_INDEX_PATH: "${{ github.workspace }}/.cr-index"
CR_PACKAGE_PATH: "${{ github.workspace }}/.cr-release-packages"
CR_TOOL_PATH: "${{ github.workspace }}/.cr-tool"
# renovate: datasource=github-tags depName=helm/chart-releaser extractVersion=^v?(?<version>.*)$
CR_TOOL_VERSION: 1.4.0
HELM_TAG_PREFIX: "${{ inputs.helm_tag_prefix }}"

jobs:
Expand Down Expand Up @@ -143,6 +145,7 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v1
with:
# renovate: datasource=github-tags depName=helm packageName=helm/helm
version: v3.5.2

- name: Add dependency chart repos
Expand Down Expand Up @@ -180,7 +183,7 @@ jobs:
mkdir "${CR_TOOL_PATH}"
mkdir "${CR_PACKAGE_PATH}"
mkdir "${CR_INDEX_PATH}"
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v1.4.0/chart-releaser_1.4.0_linux_amd64.tar.gz"
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/v${{ env.CR_TOOL_VERSION }}/chart-releaser_${{ env.CR_TOOL_VERSION }}_linux_amd64.tar.gz"
tar -xzf cr.tar.gz -C "${CR_TOOL_PATH}"
rm -f cr.tar.gz

Expand Down
3 changes: 2 additions & 1 deletion charts/agent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ apiVersion: v2
name: grafana-agent-operator
description: A Helm chart for Grafana Agent Operator
type: application
version: 0.3.18
version: 0.3.19
# 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
2 changes: 1 addition & 1 deletion charts/agent-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# grafana-agent-operator

![Version: 0.3.18](https://img.shields.io/badge/Version-0.3.18-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.2](https://img.shields.io/badge/AppVersion-0.40.2-informational?style=flat-square)
![Version: 0.3.19](https://img.shields.io/badge/Version-0.3.19-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.2](https://img.shields.io/badge/AppVersion-0.40.2-informational?style=flat-square)

A Helm chart for Grafana Agent Operator

Expand Down
3 changes: 2 additions & 1 deletion charts/enterprise-logs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
apiVersion: "v2"
name: "enterprise-logs"
type: application
version: "2.5.0"
version: "2.5.1"
# renovate: datasource=docker depName=docker.io/grafana/enterprise-logs
appVersion: "v1.5.2"
kubeVersion: "^1.10.0-0"
description: "Grafana Enterprise Logs"
Expand Down
3 changes: 2 additions & 1 deletion 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
version: 2.6.1
# 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
3 changes: 2 additions & 1 deletion 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.7
version: 7.3.8
# renovate: datasource=docker depName=docker.io/grafana/grafana
appVersion: 10.4.0
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
3 changes: 2 additions & 1 deletion charts/loki-canary/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ 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
version: 0.14.1
home: https://github.com/grafana/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion charts/loki-canary/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki-canary

![Version: 0.14.0](https://img.shields.io/badge/Version-0.14.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.1](https://img.shields.io/badge/AppVersion-2.9.1-informational?style=flat-square)
![Version: 0.14.1](https://img.shields.io/badge/Version-0.14.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.1](https://img.shields.io/badge/AppVersion-2.9.1-informational?style=flat-square)

Helm chart for Grafana Loki Canary

Expand Down
Loading