diff --git a/README.md b/README.md index d8e3a6ff61fe68aea084830041791acdeefab222..f7389b58fb8bf9c01a56b1c9f4997d1c066146ec 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/). ## Usage -This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component) +This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component) or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax. ### Use as a CI/CD component @@ -24,21 +24,20 @@ Add the following to your `.gitlab-ci.yml`: ```yaml include: # include the template - - project: 'to-be-continuous/renovate' - ref: '1.2.2' - file: '/templates/gitlab-ci-renovate.yml' + - project: "to-be-continuous/renovate" + ref: "1.2.2" + file: "/templates/gitlab-ci-renovate.yml" ``` ## Configuration The Renovate template uses some global configuration used throughout all jobs. -| Input / Variable | Description | Default value | -|------------------------|---------------------------------------------------------------------------------|-------------------| -| `image` / `RENOVATE_IMAGE` | The Docker image used to run Renovate | `registry.hub.docker.com/renovate/renovate:latest` | -| `platform` / `RENOVATE_PLATFORM` | The Platform type of repository [See doc](https://docs.renovatebot.com/self-hosted-configuration/#platform) | `gitlab` | -| :lock: `RENOVATE_TOKEN`| A GitLab access token to allow Renovate crawl your projects. [See doc](https://docs.renovatebot.com/modules/platform/gitlab/#authentication) | _none_ | -| :lock: `GITHUB_COM_TOKEN`| A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs) | _none_ | +| Input / Variable | Description | Default value | +| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- | +| `image` / `RENOVATE_IMAGE` | The Docker image used to run Renovate | `registry.hub.docker.com/renovate/renovate:latest` | +| :lock: `RENOVATE_TOKEN` | A GitLab access token to allow Renovate crawl your projects. [See doc](https://docs.renovatebot.com/modules/platform/gitlab/#authentication) | _none_ | +| :lock: `GITHUB_COM_TOKEN` | A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs) | _none_ | This template will help you using [Renovate](https://www.mend.io/renovate/) from a GitLab project to automate your dependency updates within your groups or projects. @@ -48,28 +47,28 @@ will be in charge of crawling all your other projects. Upon including the template, carefuly follow [Renovate's documentation](https://docs.renovatebot.com/) to configure the bot accordingly. Pay attention to the following: -* ~~Remember to set the [platform](https://docs.renovatebot.com/self-hosted-configuration/#platform) parameter +- ~~Remember to set the [platform](https://docs.renovatebot.com/self-hosted-configuration/#platform) parameter to `gitlab` in your configuration.~~ -* [GitLab platform integration](https://docs.renovatebot.com/modules/platform/gitlab/) requires that you +- [GitLab platform integration](https://docs.renovatebot.com/modules/platform/gitlab/) requires that you declare a `RENOVATE_TOKEN` variable with an access token. -* You'll also probaly need to declare a `GITHUB_COM_TOKEN` variable, holding a GitHub access token +- You'll also probaly need to declare a `GITHUB_COM_TOKEN` variable, holding a GitHub access token (for [fetching changelogs](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs)) ### Default Renovate configuration -This template is designed to be run on GitLab. +This template is designed to be run on GitLab. Defaults values are set to manage GitLab features : -| Renovate variable | Value | -|--------------------------------|------------------------------------------| -| [`RENOVATE_PLATFORM`](https://docs.renovatebot.com/self-hosted-configuration/#platform) | `gitlab` | -| [`RENOVATE_ENDPOINT`](https://docs.renovatebot.com/self-hosted-configuration/#endpoint) | `$CI_API_V4_URL` | -| [`RENOVATE_AUTODISCOVER_FILTER`](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) | `${CI_PROJECT_ROOT_NAMESPACE}/**` | -| [`RENOVATE_REGISTRY_ALIASES`](https://docs.renovatebot.com/configuration-options/#registryaliases) | `{"$$CI_SERVER_FQDN": "$CI_SERVER_FQDN"}`| -| [`RENOVATE_BINARY_SOURCE`](https://docs.renovatebot.com/self-hosted-configuration/#binarysource) | `install` | -| [`RENOVATE_LOG_FILE`](https://docs.renovatebot.com/config-overview/#logging-variables) | `renovate-log.ndjson` | -| [`RENOVATE_LOG_FILE_LEVEL`](https://docs.renovatebot.com/config-overview/#logging-variables) | `debug` | +| Renovate variable | Value | +| ------------------------------------------------------------------------------------------------------------ | ----------------------------------------- | +| [`RENOVATE_PLATFORM`](https://docs.renovatebot.com/self-hosted-configuration/#platform) | `gitlab` | +| [`RENOVATE_ENDPOINT`](https://docs.renovatebot.com/self-hosted-configuration/#endpoint) | `$CI_API_V4_URL` | +| [`RENOVATE_AUTODISCOVER_FILTER`](https://docs.renovatebot.com/self-hosted-configuration/#autodiscoverfilter) | `${CI_PROJECT_ROOT_NAMESPACE}/**` | +| [`RENOVATE_REGISTRY_ALIASES`](https://docs.renovatebot.com/configuration-options/#registryaliases) | `{"$$CI_SERVER_FQDN": "$CI_SERVER_FQDN"}` | +| [`RENOVATE_BINARY_SOURCE`](https://docs.renovatebot.com/self-hosted-configuration/#binarysource) | `install` | +| [`RENOVATE_LOG_FILE`](https://docs.renovatebot.com/config-overview/#logging-variables) | `renovate-log.ndjson` | +| [`RENOVATE_LOG_FILE_LEVEL`](https://docs.renovatebot.com/config-overview/#logging-variables) | `debug` | ### Dry-run implementation details @@ -83,5 +82,5 @@ The real dependency updates is triggered only when: In any other case (regular Git commit or else) the template will perform a dry run. -:warning: Dry-run behavior is enabled/disabled with the `RENOVATE_DRY_RUN` environment variable. +:warning: Dry-run behavior is enabled/disabled with the `RENOVATE_DRY_RUN` environment variable. Please don't try to override it or you might break the default template implementation. diff --git a/kicker.json b/kicker.json index 9676a4b7021d8158aae418a3214d002857e0bca2..2442ccf178681017977c1bf396f3dd3bca5c7390 100644 --- a/kicker.json +++ b/kicker.json @@ -20,11 +20,6 @@ "name": "GITHUB_COM_TOKEN", "description": "A GitHub access token to allow Renovate fetch changelogs. [See doc](https://docs.renovatebot.com/getting-started/running/#githubcom-token-for-changelogs)", "secret": true - }, - { - "name": "RENOVATE_PLATFORM", - "description": "The Platform type of repository", - "default": "gitlab" } ] } diff --git a/templates/gitlab-ci-renovate.yml b/templates/gitlab-ci-renovate.yml index fb4839b8985f7a2698f3471a8bbf06ecc392cb16..43d6312602408f7ee1458e3ec518cb2d74901681 100644 --- a/templates/gitlab-ci-renovate.yml +++ b/templates/gitlab-ci-renovate.yml @@ -19,9 +19,6 @@ spec: image: description: The Docker image used to run Renovate default: registry.hub.docker.com/renovate/renovate:latest - platform: - description: The Platform type of repository - default: gitlab --- workflow: rules: @@ -53,15 +50,16 @@ variables: TBC_TRACKING_IMAGE: registry.gitlab.com/to-be-continuous/tools/tracking:master RENOVATE_IMAGE: $[[ inputs.image ]] - RENOVATE_PLATFORM: $[[ inputs.platform ]] # those are native Renovate configuration variables # see: https://docs.renovatebot.com/self-hosted-configuration + RENOVATE_PLATFORM: gitlab RENOVATE_ENDPOINT: $CI_API_V4_URL - RENOVATE_LOG_FILE: renovate-log.ndjson RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/** RENOVATE_REGISTRY_ALIASES: "{\"$$CI_SERVER_FQDN\": \"$CI_SERVER_FQDN\"}" RENOVATE_BINARY_SOURCE: install + # see: https://docs.renovatebot.com/config-overview/#logging-variables + RENOVATE_LOG_FILE: renovate-log.ndjson RENOVATE_LOG_FILE_LEVEL: debug LOG_LEVEL: info