These are configuration examples for running a self-hosted Renovate on Jenkins pipelines. This example accesses a privately hosted GitLab instance. See self-hosting doc for additional information.
The following pipeline runs Renovate normally on the default branch (eg. main
or master
).
- Fill in the
GIT_AUTHOR_
andGIT_COMMITTER_
fields with the same account data RENOVATE_ENDPOINT
: your GitLab API endpointRENOVATE_REPOSITORIES
: your repositories to renovategitLabConnection
: your GitLab domain
RENOVATE_TOKEN
: access token for renovate to gitlab api (required)GITHUB_COM_TOKEN
: suppress github api rate limits (required)RENOVATE_EXTRA_FLAGS
: pass additional commandline args (optional)
#!groovy
pipeline {
agent {
docker {
image 'renovate/renovate:37.172.2'
args '-v /tmp:/tmp --group-add 0'
}
}
environment {
CONFIGURATION = 'Release'
TZ = 'Europe/Berlin'
ENV = '/usr/local/etc/env'
RENOVATE_TOKEN = credentials('RENOVATE_TOKEN')
GITHUB_COM_TOKEN = credentials('GITHUB_COM_TOKEN')
LOG_LEVEL = 'debug'
GIT_AUTHOR_NAME = 'Renovate Bot'
GIT_AUTHOR_EMAIL = 'bot@example.com'
GIT_COMMITTER_NAME = 'Renovate Bot'
GIT_COMMITTER_EMAIL = 'bot@example.com'
RENOVATE_PLATFORM = 'gitlab'
RENOVATE_ENDPOINT = 'https://git.example.com/api/v4/'
RENOVATE_REPOSITORIES = 'user1/repo1, user2/repo2'
RENOVATE_ONBOARDING_CONFIG = '{ "extends":["config:base"] }'
}
parameters {
string defaultValue: '', description: '', name: 'RENOVATE_EXTRA_FLAGS', trim: true
}
options {
gitLabConnection('git.example.com')
disableConcurrentBuilds()
timeout(time: 1, unit: 'HOURS')
ansiColor('xterm')
buildDiscarder logRotator(artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '240')
}
triggers {
cron('H * * * *')
}
stages {
stage('init') {
steps {
sh 'renovate --version'
sh 'rm -f renovate.log'
}
}
stage('renovate') {
steps {
sh "renovate --log-file renovate.log --log-file-level debug ${params.RENOVATE_EXTRA_FLAGS}"
}
}
}
post {
always {
archiveArtifacts allowEmptyArchive: true, artifacts: 'renovate.log'
}
}
}
args '... --group-add 0'
: give Docker container user root group rights to some required files and foldersdisableConcurrentBuilds()
: don't allow parallel execution of renovate jobs (because they would interfere with each other)
Above pipeline defines an hourly
schedule on master
branch.