Only publish on Azure for SNAPSHOT releases (#43)

* Only publish on Azure for SNAPSHOT releases

Signed-off-by: Edward Evans <edward.joshua.evans@gmail.com>

* Fix comment char

Signed-off-by: Edward Evans <edward.joshua.evans@gmail.com>
pull/44/head
Edward 5 years ago committed by Joshua Fernandes
parent 8a576a2ea1
commit 89750b3773
  1. 29
      Jenkinsfile

29
Jenkinsfile vendored

@ -298,18 +298,25 @@ exit $status
docker.image(docker_image_dind).withRun('--privileged') { d -> docker.image(docker_image_dind).withRun('--privileged') { d ->
docker.image(build_image).inside("--link ${d.id}:docker") { docker.image(build_image).inside("--link ${d.id}:docker") {
stage(stage_name + 'Prepare') { stage(stage_name + 'Calculate variables') {
sh './gradlew --no-daemon --parallel clean assemble' def gradleProperties = readProperties file: 'gradle.properties'
version = gradleProperties.version
} }
stage(stage_name + 'Publish') {
withCredentials([ if (version ==~ /.*-SNAPSHOT/) { // Only publish snapshots to Azure
usernamePassword( stage(stage_name + 'Prepare') {
credentialsId: 'hyperledger-azure', sh './gradlew --no-daemon --parallel clean assemble'
usernameVariable: 'AZURE_USER', }
passwordVariable: 'AZURE_KEY' stage(stage_name + 'Publish') {
) withCredentials([
]) { usernamePassword(
sh './gradlew --no-daemon --parallel publish' credentialsId: 'hyperledger-azure',
usernameVariable: 'AZURE_USER',
passwordVariable: 'AZURE_KEY'
)
]) {
sh './gradlew --no-daemon --parallel publish'
}
} }
} }
} }

Loading…
Cancel
Save