Skip to content

Commit 27de738

Browse files
committed
[releng] Add ability to skip deploy phase during maven build
1 parent c780b0a commit 27de738

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Jenkinsfile

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
@Library('jenkins-shared-library') _
22

3+
/**
4+
* Job Parameters:
5+
* skipTests - whether to skip unit tests during the build process or not
6+
* skipDeploy - whether to deploy build artifacts in case of successful maven build or not (should be false by default)
7+
**/
38
try {
49

510
def currentVersion
611
def revision
12+
def mavenPhase = skipDeploy ? "verify" : "deploy"
713

814
slack.notifyBuild()
915

@@ -23,19 +29,19 @@ try {
2329

2430
if (!custom_maven_settings.isEmpty()) {
2531
withMaven(jdk: 'OpenJDK_11', maven: 'Maven_3.6.3', mavenSettingsConfig: custom_maven_settings, options: [artifactsPublisher(disabled: true)], publisherStrategy: 'EXPLICIT') {
26-
sh "mvn clean deploy -Dmaven.test.skip=${skipTests} -Dmaven.install.skip=true -Dtycho.localArtifacts=ignore"
32+
sh "mvn clean ${mavenPhase} -Dmaven.test.skip=${skipTests} -Dmaven.install.skip=true -Dtycho.localArtifacts=ignore"
2733
}
2834
} else {
2935
withMaven(jdk: 'OpenJDK_11', maven: 'Maven_3.6.3', options: [artifactsPublisher(disabled: true)], publisherStrategy: 'EXPLICIT') {
30-
sh "mvn clean deploy -Dmaven.test.skip=${skipTests} -Dmaven.install.skip=true -Dtycho.localArtifacts=ignore"
36+
sh "mvn clean ${mavenPhase} -Dmaven.test.skip=${skipTests} -Dmaven.install.skip=true -Dtycho.localArtifacts=ignore"
3137
}
3238
}
3339

3440
}
3541

3642
}
3743

38-
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS')) {
44+
if (currentBuild.resultIsBetterOrEqualTo('SUCCESS') && !skipDeploy) {
3945

4046
build job: 'snow-owl-docker-build', parameters: [
4147
string(name: 'groupId', value: 'com.b2international.snowowl'),

0 commit comments

Comments
 (0)