-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
75 lines (62 loc) · 2.27 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!groovy
def releaseArgs(params) {
return (params.RELEASE_EXPLICIT.trim() == '') ?
"-Prelease.scope=${params.RELEASE_SCOPE} -Prelease.stage=final" :
"-Prelease.explicit=${params.RELEASE_EXPLICIT}"
}
def supportedBranches = '23.1.x-maintenance 23.3.x-maintenance 24.1.x-maintenance master'
String newVersion
pipeline {
agent none
environment {
GRADLE_OPTS = '-XX:MaxPermSize=256m -Xmx1024m -Djsse.enableSNIExtension=false'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10'))
skipDefaultCheckout()
timeout(time: 10, unit: 'MINUTES')
timestamps()
ansiColor('xterm')
}
parameters {
choice(name: 'RELEASE_SCOPE', choices: 'patch\nminor\nmajor', description: 'Which version component should be incremented?')
string(name: 'RELEASE_EXPLICIT', defaultValue: '', description: 'In case of a new development cycle you may need to set the version number explicitly if it is non-contiguous. E.g. put something like 1.2.3 or 1.2.3-beta.10 here.')
string(name: 'PUSHABLE_BRANCHES', defaultValue: supportedBranches, description: 'a space-separated list of branch names that will be updated')
}
stages {
stage('Release License Database') {
agent {
label 'release||release-xlr||release-xld'
}
tools {
jdk 'OpenJDK 11.0.12'
}
steps {
checkout scm
sh "./gradlew clean build uploadArchives release --no-build-cache ${releaseArgs(params)}"
script {
newVersion = readFile('build/version.dump')
}
}
}
stage('Run Update dependencies') {
steps {
script {
def updateJobs = params.PUSHABLE_BRANCHES.split('\\s+').collectEntries { branch ->
["branch $branch", { build([
job : "Update dependencies",
parameters: [
string(name: 'branch', value: branch),
string(name: 'project', value: 'groupUpdateAllDependencies'),
string(name: 'dependency', value: 'licenseDatabaseVersion'),
string(name: 'newValue', value: newVersion.substring(newVersion.lastIndexOf('=') + 1))
],
wait : false
]) }]
}
parallel(updateJobs)
}
}
}
}
}