Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/dependabot.yml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/renovate-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"onboarding": false,
"username": "renovate-release",
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
"platform": "github",
"repositories": [
"nextcloud/helm"
],
"allowedPostUpgradeCommands": ["^scripts"]
}
5 changes: 2 additions & 3 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: Lint and Test Charts

on:
pull_request:
paths:
on: pull_request

jobs:
changes:
runs-on: ubuntu-latest-low
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Renovate
on:
schedule:
# This should be every hour
- cron: '0 * * * *'
push:
branches:
- main
paths:
- ".github/renovate-config.json"
- ".github/workflows/renovate.yml"
- "renovate.json"
- "scripts/**"
jobs:
renovate:
runs-on: ubuntu-latest
steps:
- name: Get token
id: app-token
uses: actions/create-github-app-token@v1
with:
private-key: ${{ secrets.PRIVATE_KEY }}
app-id: ${{ secrets.APP_ID }}

- name: Checkout
uses: actions/checkout@v4.1.6

- name: Self-hosted Renovate
uses: renovatebot/github-action@v40.1.11
with:
configurationFile: .github/renovate-config.json
3 changes: 2 additions & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apiVersion: v2
name: nextcloud
version: 5.2.1
version: 5.2.2
# renovate: image=nextcloud
appVersion: 29.0.3
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
50 changes: 50 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"customType": "regex",
"datasourceTemplate": "docker",
"fileMatch": [
"(^|/)Chart\\.yaml$"
],
"matchStrings": [
"#\\s*renovate: image=(?<depName>.*?)\\s+appVersion:\\s*[\"']?(?<currentValue>[\\w+\\.\\-]*)"
]
}
],
"packageRules": [
{
"description": "Fix subchart archives for helm chart",
"matchManagers": ["helmv3"],
"postUpdateOptions": ["helmUpdateSubChartArchives"]
},
{
"description": "Fix version in Chart.yaml after helmv3 dep patch updates",
"matchManagers": ["helmv3"],
"matchUpdateTypes": ["patch"],
"bumpVersion": "patch"
},
{
"description": "Fix version in Chart.yaml after helmv3 dep minor updates",
"matchManagers": ["helmv3"],
"matchUpdateTypes": ["minor"],
"bumpVersion": "minor"
},
{
"description": "Fix version in Chart.yaml after helmv3 dep major updates",
"matchManagers": ["helmv3"],
"matchUpdateTypes": ["major"],
"bumpVersion": "major"
},
{
"description": "Bump helm chart versions by a patch when updating values files. Digests, pins, rollbacks, replacements and pinDigest updates are deliberately ignored since in our use case, these need a manual decision about the version bump for the chart. This can be removed when https://github.com/renovatebot/renovate/issues/8231 is implemented and enabled.",
"matchManagers": ["helm-values", "regex"],
"postUpgradeTasks": {
"commands": [
"bash scripts/bump-chart-version.sh '{{{updateType}}}'"
Copy link
Collaborator

@wrenix wrenix Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is here the Chart-name missed as first parameter? before updateType?

Suggested change
"bash scripts/bump-chart-version.sh '{{{updateType}}}'"
"bash scripts/bump-chart-version.sh '{{{parentDir}}}' '{{{updateType}}}'"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have try that code (and this changes) in an private forgejo setup. It works well.
I believe we should add this changes, rebase and try that code by merging.

],
"fileFilters": ["**/Chart.yaml"]
}
}
]
}
30 changes: 30 additions & 0 deletions scripts/bump-chart-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -euo pipefail

parent_dir="$1"
update_type="$2"

version=$(grep "^version:" "charts/${parent_dir}/Chart.yaml" | awk '{print $2}')
if [[ ! $version ]]; then
echo "No valid version was found"
exit 1
fi

major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
patch=$(echo "$version" | cut -d. -f3)

if [[ "$update_type" =~ (major|replacement) ]]; then
major=$(( major + 1 ))
minor=0
patch=0
elif [[ "$update_type" =~ 'minor' ]]; then
minor=$(( minor + 1 ))
patch=0
else
patch=$(( patch + 1 ))
fi

echo "Bumping version for $parent_dir from $version to $major.$minor.$patch"
sed -i "s/^version:.*/version: ${major}.${minor}.${patch}/g" "charts/${parent_dir}/Chart.yaml"