Skip to content

Commit f943d29

Browse files
committed
Some tweaks/fixes to jenkins pipeline; add simplistic release support
1 parent a50b0d9 commit f943d29

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

Jenkinsfile

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,45 @@ pipeline {
88
}
99
}
1010

11-
environment {
12-
ATLAS_OPTS = "-Dmaven.repo.local='$WORKSPACE/maven-cache'"
11+
parameters {
12+
string name: 'RELEASE_VERSION', defaultValue: '', description: '(leave blank for current snapshot)', trim: true
1313
}
1414

1515
stages {
1616
stage('Build plugin') {
17+
environment {
18+
// we'll be one directory deep. this is a little brittle, but there's no clean way
19+
// to use $WORKSPACE here if it contains spaces it seems
20+
ATLAS_OPTS = "-Dmaven.repo.local='../maven-cache'"
21+
}
22+
1723
steps {
1824
dir("repo/") {
25+
script {
26+
def isRelease = params.RELEASE_VERSION != ""
27+
28+
if (isRelease) {
29+
sh "atlas-mvn versinos:set -DnewVersion=${params.RELEASE_VERSION}"
30+
}
31+
}
32+
1933
//TODO: if release, atlas-mvn versions:set -DnewVersion=version
2034
sh 'atlas-unit-test'
2135
sh 'atlas-package'
36+
}
37+
}
2238

39+
post {
40+
success {
2341
archiveArtifacts artifacts: 'target/codedx-bamboo-plugin*.jar', fingerprint: true, onlyIfSuccessful: true
42+
43+
script {
44+
if (isRelease) {
45+
currentBuild.displayName = params.RELEASE_VERSION
46+
currentBuild.description = "Release build ${params.RELEASE_VERSION}"
47+
currentBuild.setKeepLog(true)
48+
}
49+
}
2450
}
2551
}
2652
}

0 commit comments

Comments
 (0)