-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathJenkinsfile
More file actions
102 lines (98 loc) · 3.48 KB
/
Jenkinsfile
File metadata and controls
102 lines (98 loc) · 3.48 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
@Library('gbif-common-jenkins-pipelines') _
pipeline {
agent any
tools {
maven 'Maven 3.9.9'
jdk 'OpenJDK17'
}
options {
buildDiscarder(logRotator(numToKeepStr: '5'))
skipStagesAfterUnstable()
timestamps()
disableConcurrentBuilds()
}
triggers {
snapshotDependencies()
}
parameters {
separator(name: "release_separator", sectionHeader: "Release Main Project Parameters")
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Do a Maven release')
string(name: 'RELEASE_VERSION', defaultValue: '', description: 'Release version (optional)')
string(name: 'DEVELOPMENT_VERSION', defaultValue: '', description: 'Development version (optional)')
booleanParam(name: 'DRY_RUN_RELEASE', defaultValue: false, description: 'Dry Run Maven release')
}
environment {
JETTY_PORT = utils.getPort()
}
stages {
stage('Maven build') {
when {
allOf {
not { expression { params.RELEASE } };
}
}
steps {
withMaven(
globalMavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig1387378707709',
mavenOpts: '-Xms2048m -Xmx8192m',
mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1396361652540',
traceability: true) {
configFileProvider([
configFile(fileId: 'org.jenkinsci.plugins.configfiles.custom.CustomConfig1389220396351', variable: 'APPKEYS_TESTFILE')
]) {
sh '''
mvn -B -Denforcer.skip=true -Dappkeys.testfile=$APPKEYS_TESTFILE clean install deploy verify -T 1C \
-Dparallel=classes -DuseUnlimitedThreads=true -Pgbif-dev,registry-cli-it,secrets-dev -U
'''
}
}
}
}
stage('Trigger WS deploy dev') {
when {
allOf {
not { expression { params.RELEASE } };
branch 'dev';
}
}
steps {
build job: "registry-dev-deploy", wait: false, propagate: false
}
}
stage('Maven release') {
when {
allOf {
expression { params.RELEASE };
branch 'master';
}
}
environment {
RELEASE_ARGS = utils.createReleaseArgs(params.RELEASE_VERSION, params.DEVELOPMENT_VERSION, params.DRY_RUN_RELEASE)
}
steps {
withMaven(globalMavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.GlobalMavenSettingsConfig1387378707709',
mavenOpts: '-Xms2048m -Xmx8192m', mavenSettingsConfig: 'org.jenkinsci.plugins.configfiles.maven.MavenSettingsConfig1396361652540',
traceability: true) {
configFileProvider([
configFile(fileId: 'org.jenkinsci.plugins.configfiles.custom.CustomConfig1389220396351', variable: 'APPKEYS_TESTFILE')
]) {
git 'https://github.com/gbif/registry.git'
sh '''
mvn -B \
release:prepare release:perform -Darguments="-Djetty.port=$HTTP_PORT -Dappkeys.testfile=$APPKEYS_TESTFILE" \
-T 1C -Dparallel=classes -DuseUnlimitedThreads=true -Pgbif-dev,secrets-dev,registry-cli-it $RELEASE_ARGS
'''
}
}
}
}
}
post {
success {
echo 'Pipeline executed successfully!'
}
failure {
echo 'Pipeline execution failed!'
}
}
}