diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2226e8c2008c02c3ba86aaf2c410e3456d1ec8e8..3b4b91598932188e6198cb850b822644c79861e3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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' diff --git a/README.md b/README.md index 1392bcb1c8fdb251a46734ca3122f9d84432285a..abaa152f2f8b5d5992244d51a97542aa68b9eb52 100644 --- a/README.md +++ b/README.md @@ -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_ | diff --git a/bumpversion.sh b/bumpversion.sh index f06829a406ca8da98e570e8ad7d8bb22367b668d..ed44d7b68b0e09f6d2cf557f7a15e52553246341 100755 --- a/bumpversion.sh +++ b/bumpversion.sh @@ -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 diff --git a/kicker.json b/kicker.json index c1cb213f22bdc5b9ee3c2fbc69b09297b17165bb..2442ccf178681017977c1bf396f3dd3bca5c7390 100644 --- a/kicker.json +++ b/kicker.json @@ -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", diff --git a/logo.png b/logo.png index 70753a173ed09089752a12e8a2006dc8dfc927c2..9fb664b1c2bd5957ea907c27c264e943ce7ee7d0 100644 Binary files a/logo.png and b/logo.png differ diff --git a/templates/gitlab-ci-renovate.yml b/templates/gitlab-ci-renovate.yml index a499b4caa12463fbcdde7d947ebff4be3b65ae88..9e70df771b3097ff3acc90410f90b638b84930c4 100644 --- a/templates/gitlab-ci-renovate.yml +++ b/templates/gitlab-ci-renovate.yml @@ -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