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

Merge branch...

Merge branch '2-be-able-to-update-component-with-ci_server_fqdn-variable-in-component-path' into 'master'

Resolve "be able to update component with CI_SERVER_FQDN variable in component path"

Closes #2

See merge request to-be-continuous/renovate!10
parents fbeae357 37f1acad
Branches
Tags
No related merge requests found
...@@ -4,7 +4,7 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/). ...@@ -4,7 +4,7 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/).
## Usage ## 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. or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax.
### Use as a CI/CD component ### Use as a CI/CD component
...@@ -24,21 +24,20 @@ Add the following to your `.gitlab-ci.yml`: ...@@ -24,21 +24,20 @@ Add the following to your `.gitlab-ci.yml`:
```yaml ```yaml
include: include:
# include the template # include the template
- project: 'to-be-continuous/renovate' - project: "to-be-continuous/renovate"
ref: '1.2.2' ref: "1.2.2"
file: '/templates/gitlab-ci-renovate.yml' file: "/templates/gitlab-ci-renovate.yml"
``` ```
## Configuration ## Configuration
The Renovate template uses some global configuration used throughout all jobs. The Renovate template uses some global configuration used throughout all jobs.
| Input / Variable | Description | Default value | | Input / Variable | Description | Default value |
|------------------------|---------------------------------------------------------------------------------|-------------------| | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| `image` / `RENOVATE_IMAGE` | The Docker image used to run Renovate | `registry.hub.docker.com/renovate/renovate:latest` | | `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: `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_ |
| :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 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. automate your dependency updates within your groups or projects.
...@@ -48,13 +47,29 @@ will be in charge of crawling all your other projects. ...@@ -48,13 +47,29 @@ will be in charge of crawling all your other projects.
Upon including the template, carefuly follow [Renovate's documentation](https://docs.renovatebot.com/) to Upon including the template, carefuly follow [Renovate's documentation](https://docs.renovatebot.com/) to
configure the bot accordingly. Pay attention to the following: 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.~~ 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. 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)) (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.
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` |
### Dry-run implementation details ### Dry-run implementation details
Depending on the source of a pipeline, the template will either perform your dependency updates (create/update/delete branches and MRs) Depending on the source of a pipeline, the template will either perform your dependency updates (create/update/delete branches and MRs)
...@@ -67,5 +82,5 @@ The real dependency updates is triggered only when: ...@@ -67,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. 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. Please don't try to override it or you might break the default template implementation.
...@@ -20,11 +20,6 @@ ...@@ -20,11 +20,6 @@
"name": "GITHUB_COM_TOKEN", "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)", "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 "secret": true
},
{
"name": "RENOVATE_PLATFORM",
"description": "The Platform type of repository",
"default": "gitlab"
} }
] ]
} }
...@@ -19,9 +19,6 @@ spec: ...@@ -19,9 +19,6 @@ spec:
image: image:
description: The Docker image used to run Renovate description: The Docker image used to run Renovate
default: registry.hub.docker.com/renovate/renovate:latest default: registry.hub.docker.com/renovate/renovate:latest
platform:
description: The Platform type of repository
default: gitlab
--- ---
workflow: workflow:
rules: rules:
...@@ -53,14 +50,16 @@ variables: ...@@ -53,14 +50,16 @@ variables:
TBC_TRACKING_IMAGE: registry.gitlab.com/to-be-continuous/tools/tracking:master TBC_TRACKING_IMAGE: registry.gitlab.com/to-be-continuous/tools/tracking:master
RENOVATE_IMAGE: $[[ inputs.image ]] RENOVATE_IMAGE: $[[ inputs.image ]]
RENOVATE_PLATFORM: $[[ inputs.platform ]]
# those are native Renovate configuration variables # those are native Renovate configuration variables
# see: https://docs.renovatebot.com/self-hosted-configuration # see: https://docs.renovatebot.com/self-hosted-configuration
RENOVATE_PLATFORM: gitlab
RENOVATE_ENDPOINT: $CI_API_V4_URL RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_LOG_FILE: renovate-log.ndjson
RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/** RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/**
RENOVATE_REGISTRY_ALIASES: "{\"$$CI_SERVER_FQDN\": \"$CI_SERVER_FQDN\"}"
RENOVATE_BINARY_SOURCE: install RENOVATE_BINARY_SOURCE: install
# see: https://docs.renovatebot.com/config-overview/#logging-variables
RENOVATE_LOG_FILE: renovate-log.ndjson
RENOVATE_LOG_FILE_LEVEL: debug RENOVATE_LOG_FILE_LEVEL: debug
LOG_LEVEL: info LOG_LEVEL: info
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment