Skip to content

Commit

Permalink
Merge pull request #930 from jenkins-infra/improve-renovate
Browse files Browse the repository at this point in the history
Upgrade renovate config so it handles node, and ignores remark
  • Loading branch information
halkeye authored Dec 18, 2021
2 parents b084ec6 + f1d34fe commit b1ce0c3
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 21 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.13.1
47 changes: 29 additions & 18 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ pipeline {
environment {
GET_CONTENT = "true"
NODE_ENV = "production"
HOME = "/tmp"
TZ = "UTC"
}

Expand All @@ -18,42 +19,52 @@ pipeline {
stages {

stage('NPM Install') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
runDockerCommand('node:14.17', 'yarn install')
sh('yarn install')
}
}

stage('Build Production') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
runDockerCommand('node:14.17', 'yarn build')
sh('yarn build')
}
}

stage('Check build') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
sh 'test -e ./plugins/plugin-site/public/index.html || exit 1'
}
}

stage('Lint and Test') {
agent {
docker {
image 'node:14.17'
reuseNode true
}
}
steps {
runDockerCommand('node:14.17', 'yarn lint')
runDockerCommand('node:14.17', 'yarn test')
sh('yarn lint')
sh('yarn test')
}
}
}
}

def runDockerCommand(image, cmd) {
sh """
docker run \
--network host \
--rm -e GET_CONTENT \
-w "\$PWD" \
-e HOME="/tmp" \
-v "\$PWD:\$PWD" \
-u \$(id -u):\$(id -g) \
$image \
$cmd
"""
}
47 changes: 44 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,55 @@
"schedule": [
"every weekday"
],
"labels": ["dependencies"],
"labels": [
"dependencies"
],
"npm": {
"stabilityDays": 3
},
"regexManagers": [
{
"fileMatch": [
"^Jenkinsfile$",
"^Jenkinsfile_k8s$"
],
"matchStrings": [
"image '(?<depName>[a-z/-]+):(?<currentValue>[a-z0-9.-]+)@(?<currentDigest>sha256:[a-f0-9]+)'",
"image: \"(?<depName>[a-z/-]+):(?<currentValue>[a-z0-9.-]+)@(?<currentDigest>sha256:[a-f0-9]+)\""
],
"datasourceTemplate": "docker",
"versioningTemplate": "docker"
}
],
"packageRules": [
{
"matchPackageNames": ["p-queue", "husky"],
"matchPackageNames": [
"node"
],
"major": {
"enabled": true
},
"separateMultipleMajor": true,
"allowedVersions": "^14 || ^16 || ^18 || ^20"
},
{
"extends": "monorepo:remark",
"enabled": false
},
{
"matchPackageNames": [
"p-queue",
"husky"
],
"enabled": false
},
{
"matchUpdateTypes": ["minor", "patch", "pin", "digest"],
"matchUpdateTypes": [
"minor",
"patch",
"pin",
"digest"
],
"automerge": true
}
]
Expand Down

0 comments on commit b1ce0c3

Please sign in to comment.