From 7a9df83d18e8c8fa86567457086fee1d6885abf1 Mon Sep 17 00:00:00 2001 From: mmalyska Date: Wed, 27 Sep 2023 07:31:52 +0000 Subject: [PATCH] Update readme with renovate configuration for digest updates (#514) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description of the change Update README with information how to configure renovate to update digest for gitea charts. ### Benefits Automatic digest updates for people using renovate. Co-authored-by: Michał Małyska <999598+mmalyska@users.noreply.github.com> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/514 Reviewed-by: justusbunsi Reviewed-by: pat-s Co-authored-by: mmalyska Co-committed-by: mmalyska --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 37e57ff..03bed71 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ - [Metrics and profiling](#metrics-and-profiling) - [Pod annotations](#pod-annotations) - [Themes](#themes) +- [Renovate](#renovate) - [Parameters](#parameters) - [Global](#global) - [strategy](#strategy) @@ -691,6 +692,34 @@ or natively via `kubectl`: kubectl create secret generic gitea-themes --from-file={{FULL-PATH-TO-CSS}} --namespace gitea ``` +## Renovate + +To be able to use a digest value which is automatically updated by `Renovate` a [customManager](https://docs.renovatebot.com/modules/manager/regex/) is required. +Here's an examplary `values.yml` definition which makes use of a digest: + +```yaml +image: + repository: gitea/gitea + tag: 1.20.2 + digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f +``` + +By default Renovate adds digest after the `tag`. +To comply with the Gitea helm chart definition of the digest parameter, a "customManagers" definition is required: + +```json +"customManagers": [ + { + "customType": "regex", + "description": "Apply an explicit gitea digest field match", + "fileMatch": ["values\\.ya?ml"], + "matchStrings": ["(?gitea\\/gitea)\\n(?\\s+)tag: (?[^@].*?)\\n\\s+digest: (?sha256:[a-f0-9]+)"], + "datasourceTemplate": "docker", + "autoReplaceStringTemplate": "{{depName}}\n{{indentation}}tag: {{newValue}}\n{{indentation}}digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}" + } +] +``` + ## Parameters ### Global