Skip to content
Snippets Groups Projects
Commit 37f1acad authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix: remove RENOVATE_PLATFORM as configurable param

parent 6dd0b9dd
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......@@ -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"
}
]
}
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment