Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit d81a26f

Browse files
author
Asgeir Nilsen
committed
Updated Jenkinsfile to golden master.
1 parent 2823b9b commit d81a26f

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

Jenkinsfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,36 @@ pipeline {
22
agent none
33
stages {
44
stage('Build') {
5-
agent {
5+
agent {
66
docker {
77
label 'docker'
8-
image 'gradle:4.2.1-jdk8-alpine'
8+
image 'gradle:4.6.0-jdk8-alpine'
99
}
1010
}
1111
steps {
1212
sh 'gradle --no-daemon clean build'
13-
stash includes: 'build/libs/*.jar', name: 'libs'
13+
archiveArtifacts 'build/libs/*.jar'
1414
}
1515
}
1616
stage('Deploy') {
17-
agent {
17+
agent {
1818
docker {
1919
label 'docker'
20-
image 'gradle:4.2.1-jdk8-alpine'
20+
image 'gradle:4.6.0-jdk8-alpine'
2121
}
2222
}
2323
environment {
2424
BINTRAY = credentials('fint-bintray')
2525
}
2626
when {
27-
branch 'master'
27+
expression { env.TAG_NAME != null && env.TAG_NAME ==~ /v\d+\.\d+\.\d+(-\w+-\d+)?/ }
2828
}
2929
steps {
30-
unstash 'libs'
31-
archiveArtifacts 'build/libs/*.jar'
32-
sh 'gradle --no-daemon -PbintrayUser=${BINTRAY_USR} -PbintrayKey=${BINTRAY_PSW} bintrayUpload'
30+
script {
31+
VERSION = TAG_NAME[1..-1]
32+
}
33+
sh "echo Version is ${VERSION}"
34+
sh "gradle --no-daemon -Pversion=${VERSION} -PbintrayUser=${BINTRAY_USR} -PbintrayKey=${BINTRAY_PSW} bintrayUpload"
3335
}
3436
}
3537
}

0 commit comments

Comments
 (0)