diff --git a/.gitlab/README.md.template b/.gitlab/README.md.template index d0fc0ec2a10b462ca9295da9cabe8e0ba12f3236..849b65d35f593fc508ef7d840b22ca3c97292f0e 100644 --- a/.gitlab/README.md.template +++ b/.gitlab/README.md.template @@ -280,6 +280,54 @@ However, we cannot use the alternative `+` which would indicate build metadata as we'd like. See https://github.com/distribution/distribution/issues/1201* +### Using with Renovate + +To keep the component versions up to date you could use [Renovate](https://docs.renovatebot.com/). + +Renovate users who use the component input `opentofu_version` should include the following `extends` +so that the OpenTofu version is raised to a maximum of the version suitable for the component: + +```json +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>components/opentofu"], + ... +} +``` +(You may need to adjust the path to the `components/opentofu` to match your mirror.) +Fore more details refer to the [Renovate documentation](https://docs.renovatebot.com/config-presets/). + +Some more example configurations for your `renovate.json`: + +- Package Rule to update all CI-Components + ```json + { + "matchFileNames": [ + ".gitlab-ci.yaml", + ".gitlab-ci.yml", + "templates/**/*.yaml", + "templates/**/*.yml" + ], + "groupName": "Pipeline", + "semanticCommitType": "ci", + "automerge": true + }, + ``` +- Package rule to pin only `major.minor` versions: + ```json + { + "matchManagers": ["gitlabci"], + "extractVersion": "^(?<version>\\d+\\.\\d+)" + }, + ``` +- Package rule to target a specific component: + ```json + { + "matchPackageNames": ["components/opentofu"], + "matchManagers": ["gitlabci"] + }, + ``` + ## Usage on self-managed GitLab CI/CD components are not yet distributed and available on self-managed GitLab instances. diff --git a/README.md b/README.md index 7db20ca05af372a8621856c57de21e3699014365..d4d5a3805cad21e2ee42b48f0d9f68e973e24be7 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,54 @@ However, we cannot use the alternative `+` which would indicate build metadata as we'd like. See https://github.com/distribution/distribution/issues/1201* +### Using with Renovate + +To keep the component versions up to date you could use [Renovate](https://docs.renovatebot.com/). + +Renovate users who use the component input `opentofu_version` should include the following `extends` +so that the OpenTofu version is raised to a maximum of the version suitable for the component: + +```json +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["local>components/opentofu"], + ... +} +``` +(You may need to adjust the path to the `components/opentofu` to match your mirror.) +Fore more details refer to the [Renovate documentation](https://docs.renovatebot.com/config-presets/). + +Some more example configurations for your `renovate.json`: + +- Package Rule to update all CI-Components + ```json + { + "matchFileNames": [ + ".gitlab-ci.yaml", + ".gitlab-ci.yml", + "templates/**/*.yaml", + "templates/**/*.yml" + ], + "groupName": "Pipeline", + "semanticCommitType": "ci", + "automerge": true + }, + ``` +- Package rule to pin only `major.minor` versions: + ```json + { + "matchManagers": ["gitlabci"], + "extractVersion": "^(?<version>\\d+\\.\\d+)" + }, + ``` +- Package rule to target a specific component: + ```json + { + "matchPackageNames": ["components/opentofu"], + "matchManagers": ["gitlabci"] + }, + ``` + ## Usage on self-managed GitLab CI/CD components are not yet distributed and available on self-managed GitLab instances.