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

feat: migrate to CI/CD component

:warning: requires GitLab 16.6 or later
parent b2e48ca1
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ include: ...@@ -10,7 +10,7 @@ include:
file: '/templates/validation.yml' file: '/templates/validation.yml'
- project: 'to-be-continuous/bash' - project: 'to-be-continuous/bash'
ref: '3.3' ref: '3.3'
file: 'templates/gitlab-ci-bash.yml' file: '/templates/gitlab-ci-bash.yml'
- project: 'to-be-continuous/semantic-release' - project: 'to-be-continuous/semantic-release'
ref: '3.7' ref: '3.7'
file: '/templates/gitlab-ci-semrel.yml' file: '/templates/gitlab-ci-semrel.yml'
......
...@@ -4,10 +4,26 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/). ...@@ -4,10 +4,26 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/).
## Usage ## Usage
In order to include this template in your project, add the following to your `gitlab-ci.yml`: This template can be used both as a [CI/CD component](https://docs.gitlab.com/ee/ci/components/#use-a-component-in-a-cicd-configuration)
or using the legacy [`include:project`](https://docs.gitlab.com/ee/ci/yaml/index.html#includeproject) syntax.
### Use as a CI/CD component
Add the following to your `gitlab-ci.yml`:
```yaml
include:
# include the component
- component: gitlab.com/to-be-continuous/renovate/gitlab-ci-renovate@1.1.0
```
### Use as a CI/CD template (legacy)
Add the following to your `gitlab-ci.yml`:
```yaml ```yaml
include: include:
# include the template
- project: 'to-be-continuous/renovate' - project: 'to-be-continuous/renovate'
ref: '1.1.0' ref: '1.1.0'
file: '/templates/gitlab-ci-renovate.yml' file: '/templates/gitlab-ci-renovate.yml'
...@@ -17,9 +33,9 @@ include: ...@@ -17,9 +33,9 @@ include:
The Renovate template uses some global configuration used throughout all jobs. The Renovate template uses some global configuration used throughout all jobs.
| Name | Description | Default value | | Input / Variable | Description | Default value |
|------------------------|---------------------------------------------------------------------------------|-------------------| |------------------------|---------------------------------------------------------------------------------|-------------------|
| `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` |
| :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_ |
......
...@@ -27,13 +27,13 @@ if [[ "$curVer" ]]; then ...@@ -27,13 +27,13 @@ if [[ "$curVer" ]]; then
log_info "Bump version from \\e[33;1m${curVer}\\e[0m to \\e[33;1m${nextVer}\\e[0m (release type: $relType)..." log_info "Bump version from \\e[33;1m${curVer}\\e[0m to \\e[33;1m${nextVer}\\e[0m (release type: $relType)..."
# replace in README # replace in README
sed -e "s/ref: '$curVer'/ref: '$nextVer'/" README.md > README.md.next sed -e "s/ref: *'$curVer'/ref: '$nextVer'/" -e "s/ref: *\"$curVer\”/ref: \”$nextVer\”/" -e "s/component: *\(.*\)@$curVer/component: \1@$nextVer/" README.md > README.md.next
mv -f README.md.next README.md mv -f README.md.next README.md
# replace in template and variants # replace in template and variants
for tmpl in templates/*.yml for tmpl in templates/*.yml
do do
sed -e "s/\"$curVer\"/\"$nextVer\"/" "$tmpl" > "$tmpl.next" sed -e "s/command: *\[\"--service\", \"\(.*\)\", \"$curVer\"\]/command: [\"--service\", \"\1\", \"$nextVer\"]/" "$tmpl" > "$tmpl.next"
mv -f "$tmpl.next" "$tmpl" mv -f "$tmpl.next" "$tmpl"
done done
else else
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
"description": "Automate your dependency updates with [Renovate](https://www.mend.io/renovate/)", "description": "Automate your dependency updates with [Renovate](https://www.mend.io/renovate/)",
"template_path": "templates/gitlab-ci-renovate.yml", "template_path": "templates/gitlab-ci-renovate.yml",
"kind": "misc", "kind": "misc",
"prefix": "renovate",
"is_component": true,
"variables": [ "variables": [
{ {
"name": "RENOVATE_IMAGE", "name": "RENOVATE_IMAGE",
......
logo.png

5.24 KiB | W: | H:

logo.png

25.8 KiB | W: | H:

logo.png
logo.png
logo.png
logo.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -14,6 +14,12 @@ ...@@ -14,6 +14,12 @@
# Floor, Boston, MA 02110-1301, USA. # Floor, Boston, MA 02110-1301, USA.
# ========================================================================================= # =========================================================================================
# default workflow rules: Merge Request pipelines # default workflow rules: Merge Request pipelines
spec:
inputs:
image:
description: The Docker image used to run Renovate
default: registry.hub.docker.com/renovate/renovate:latest
---
workflow: workflow:
rules: rules:
# prevent branch pipeline when an MR is open (prefer MR pipeline) # prevent branch pipeline when an MR is open (prefer MR pipeline)
...@@ -38,13 +44,15 @@ workflow: ...@@ -38,13 +44,15 @@ workflow:
variables: variables:
# variabilized tracking image # variabilized tracking image
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: "registry.hub.docker.com/renovate/renovate:latest" RENOVATE_IMAGE: $[[ inputs.image ]]
RENOVATE_ENDPOINT: $CI_API_V4_URL
# those are native Renovate configuration variables
# see: https://docs.renovatebot.com/self-hosted-configuration
RENOVATE_ENDPOINT: $CI_API_V4_URL
RENOVATE_LOG_FILE: renovate-log.ndjson RENOVATE_LOG_FILE: renovate-log.ndjson
RENOVATE_AUTODISCOVER_FILTER: '${CI_PROJECT_ROOT_NAMESPACE}/**' RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/**
RENOVATE_BINARY_SOURCE: install RENOVATE_BINARY_SOURCE: install
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