1
0
Fork 0
mirror of https://gitlab.com/renovate-bot/renovate-runner.git synced 2025-04-18 06:48:22 +02:00

chore: add lint and use conventionalcommits (renovate-bot/renovate-runner!352)

This commit is contained in:
Michael Kriese 2022-01-18 14:51:29 +00:00
parent 574fd05a58
commit 5a73d3b9c3
9 changed files with 97 additions and 46 deletions

View file

@ -12,6 +12,23 @@ renovate:dry-run:
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
lint:
image: renovate/node:16.13.2@sha256:dcbbcf37dd8a6de7a80020dd44197afc6564a1a7dd2a50fb089be1d5d259b3f3
stage: test
cache:
key:
files:
- package-lock.json
paths:
- .npm/
before_script:
- npm ci --cache .npm --prefer-offline
script:
- npm run prettier
rules:
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
release:
image: renovate/node:16.13.2@sha256:dcbbcf37dd8a6de7a80020dd44197afc6564a1a7dd2a50fb089be1d5d259b3f3
stage: release

1
.npmrc Normal file
View file

@ -0,0 +1 @@
save-exact = true

View file

@ -4,6 +4,7 @@
"@semantic-release/release-notes-generator",
"@semantic-release/gitlab"
],
"preset": "conventionalcommits",
"branches": [
{
"name": "main"

View file

@ -30,7 +30,7 @@ This will mean no new projects will be onboarded.
However, we recommend you apply an `autodiscoverFilter` value like the following so that the bot does not run on any stranger's project it gets invited to: `RENOVATE_EXTRA_FLAGS`: `--autodiscover=true --autodiscover-filter=group1/*`.
Checkout renovate [docs](https://docs.renovatebot.com/gitlab-bot-security/) for more information about gitlab security.
If you wish for your bot to run against *every* project which the `RENOVATE_TOKEN` PAT has access to, and onboard any projects which don't yet have a config, then add this variable: `RENOVATE_EXTRA_FLAGS`: `--autodiscover=true --onboarding=true --autodiscover-filter=group1/*`.
If you wish for your bot to run against _every_ project which the `RENOVATE_TOKEN` PAT has access to, and onboard any projects which don't yet have a config, then add this variable: `RENOVATE_EXTRA_FLAGS`: `--autodiscover=true --onboarding=true --autodiscover-filter=group1/*`.
If you wish to manually specify which projects that your bot runs again, then add this variable with a space-delimited set of project names: `RENOVATE_EXTRA_FLAGS`: `group1/repo5 user3/repo1`.
@ -40,19 +40,19 @@ Create a `.gitlab-ci.yml` file in the repository like the following:
```yaml
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
```
If you are using a custom GitLab Kubernetes runner you probably need to downgrade the Docker DinD service because of [containerd/containerd#4837](https://github.com/containerd/containerd/issues/4837)
```yaml
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
services:
- docker:19.03.15-dind
- docker:19.03.15-dind
```
Alternatively, if you cannot use the gitlab.com hosted or self-hosted privileged runners, include the following template instead.
@ -63,17 +63,17 @@ So please prefer the DinD version.
```yaml
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate.gitlab-ci.yml'
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate.gitlab-ci.yml'
```
To prevent unexpected changes in your pipeline, you can pin the version of this template and include it in your Renovate updates:
```yaml
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
ref: v1.0.0
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
ref: v1.0.0
```
Please check this project's [Releases page](https://gitlab.com/renovate-bot/renovate-runner/-/releases)
@ -86,14 +86,14 @@ Example to run on schedules and pushes:
```yaml
include:
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
- project: 'renovate-bot/renovate-runner'
file: '/templates/renovate-dind.gitlab-ci.yml'
renovate:
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "push"'
```
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_PIPELINE_SOURCE == "push"'
```
## Configure the Schedule

45
package-lock.json generated
View file

@ -6,6 +6,8 @@
"": {
"devDependencies": {
"@semantic-release/gitlab": "7.0.4",
"conventional-changelog-conventionalcommits": "4.6.3",
"prettier": "2.5.1",
"semantic-release": "18.0.1"
}
},
@ -850,6 +852,20 @@
"node": ">=10"
}
},
"node_modules/conventional-changelog-conventionalcommits": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz",
"integrity": "sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==",
"dev": true,
"dependencies": {
"compare-func": "^2.0.0",
"lodash": "^4.17.15",
"q": "^1.5.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/conventional-changelog-writer": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz",
@ -5859,6 +5875,18 @@
"node": ">=4"
}
},
"node_modules/prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"dev": true,
"bin": {
"prettier": "bin-prettier.js"
},
"engines": {
"node": ">=10.13.0"
}
},
"node_modules/process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@ -7685,6 +7713,17 @@
"q": "^1.5.1"
}
},
"conventional-changelog-conventionalcommits": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.6.3.tgz",
"integrity": "sha512-LTTQV4fwOM4oLPad317V/QNQ1FY4Hju5qeBIM1uTHbrnCE+Eg4CdRZ3gO2pUeR+tzWdp80M2j3qFFEDWVqOV4g==",
"dev": true,
"requires": {
"compare-func": "^2.0.0",
"lodash": "^4.17.15",
"q": "^1.5.1"
}
},
"conventional-changelog-writer": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-5.0.1.tgz",
@ -11361,6 +11400,12 @@
}
}
},
"prettier": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz",
"integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==",
"dev": true
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",

View file

@ -1,6 +1,12 @@
{
"devDependencies": {
"semantic-release": "18.0.1",
"@semantic-release/gitlab": "7.0.4"
"@semantic-release/gitlab": "7.0.4",
"conventional-changelog-conventionalcommits": "4.6.3",
"prettier": "2.5.1",
"semantic-release": "18.0.1"
},
"scripts": {
"prettier": "prettier --check --ignore-unknown \"**/*.*\"",
"prettier-fix": "prettier --write --ignore-unknown \"**/*.*\""
}
}

View file

@ -1,16 +1,11 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>renovatebot/.github"
],
"extends": ["github>renovatebot/.github"],
"platformAutomerge": true,
"packageRules": [
{
"description": "Trigger breaking release for major updates",
"matchPackageNames": [
"docker",
"renovate/renovate"
],
"matchPackageNames": ["docker", "renovate/renovate"],
"matchUpdateTypes": ["major"],
"semanticCommitType": "feat",
"commitBody": "BREAKING CHANGE: Major update",
@ -18,29 +13,21 @@
},
{
"description": "Trigger feature release for minor updates",
"matchPackageNames": [
"docker",
"renovate/renovate"
],
"matchPackageNames": ["docker", "renovate/renovate"],
"matchUpdateTypes": ["minor"],
"semanticCommitType": "feat",
"automergeType": "pr"
},
{
"description": "Trigger fix release for patch updates",
"matchPackageNames": [
"docker",
"renovate/renovate"
],
"matchPackageNames": ["docker", "renovate/renovate"],
"matchUpdateTypes": ["patch", "digest"],
"semanticCommitType": "fix",
"automergeType": "pr"
},
{
"description": "Allow updates after 3 days (exclude renovate)",
"excludePackageNames": [
"renovate/renovate"
],
"excludePackageNames": ["renovate/renovate"],
"separateMinorPatch": true,
"stabilityDays": 3
},
@ -57,9 +44,7 @@
"regexManagers": [
{
"description": "Update docker references in gitlab variables",
"fileMatch": [
"\\.gitlab-ci\\.yml$"
],
"fileMatch": ["\\.gitlab-ci\\.yml$"],
"matchStrings": [
"CI_RENOVATE_IMAGE\\s*:\\s*(?<depName>renovate\\/renovate):(?<currentValue>[a-z0-9.-]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?",
"CI_RENOVATE_SERVICE\\s*:\\s*(?<depName>docker):(?<currentValue>[a-z0-9.-]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
@ -69,9 +54,7 @@
}
],
"gitlabci": {
"fileMatch": [
"\\.gitlab-ci\\.yml$"
],
"fileMatch": ["\\.gitlab-ci\\.yml$"],
"pinDigests": true
}
}

View file

@ -20,7 +20,6 @@ default:
paths:
- renovate/cache/renovate/repository/**/*.json
renovate:
stage: deploy
resource_group: production
@ -32,4 +31,4 @@ renovate:
when: always
expire_in: 1d
paths:
- "$RENOVATE_LOG_FILE"
- '$RENOVATE_LOG_FILE'

View file

@ -6,7 +6,6 @@ services:
- name: ${CI_RENOVATE_SERVICE}
alias: docker
variables:
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2376