Skip to content
Snippets Groups Projects
Commit bfe85e75 authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

Merge branch 'feat/component' into 'master'

feat: migrate to CI/CD component

See merge request to-be-continuous/renovate!4
parents b2e48ca1 0ee4e8d8
Branches
Tags
No related merge requests found
......@@ -10,7 +10,7 @@ include:
file: '/templates/validation.yml'
- project: 'to-be-continuous/bash'
ref: '3.3'
file: 'templates/gitlab-ci-bash.yml'
file: '/templates/gitlab-ci-bash.yml'
- project: 'to-be-continuous/semantic-release'
ref: '3.7'
file: '/templates/gitlab-ci-semrel.yml'
......
......@@ -4,10 +4,26 @@ Automate your dependency updates with [Renovate](https://www.mend.io/renovate/).
## 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
include:
# include the template
- project: 'to-be-continuous/renovate'
ref: '1.1.0'
file: '/templates/gitlab-ci-renovate.yml'
......@@ -17,9 +33,9 @@ include:
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: `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
log_info "Bump version from \\e[33;1m${curVer}\\e[0m to \\e[33;1m${nextVer}\\e[0m (release type: $relType)..."
# 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
# replace in template and variants
for tmpl in templates/*.yml
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"
done
else
......
......@@ -3,6 +3,8 @@
"description": "Automate your dependency updates with [Renovate](https://www.mend.io/renovate/)",
"template_path": "templates/gitlab-ci-renovate.yml",
"kind": "misc",
"prefix": "renovate",
"is_component": true,
"variables": [
{
"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 @@
# Floor, Boston, MA 02110-1301, USA.
# =========================================================================================
# 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:
rules:
# prevent branch pipeline when an MR is open (prefer MR pipeline)
......@@ -38,13 +44,15 @@ workflow:
variables:
# 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 ]]
# 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_AUTODISCOVER_FILTER: '${CI_PROJECT_ROOT_NAMESPACE}/**'
RENOVATE_AUTODISCOVER_FILTER: ${CI_PROJECT_ROOT_NAMESPACE}/**
RENOVATE_BINARY_SOURCE: install
RENOVATE_LOG_FILE_LEVEL: debug
LOG_LEVEL: info
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment