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(build_image).inside("--link ${d.id}:docker") {
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
stage(stage_name + 'Calculate variables') {
def gradleProperties = readProperties file: 'gradle.properties'
version = gradleProperties.version
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'hyperledger-azure',
usernameVariable: 'AZURE_USER',
passwordVariable: 'AZURE_KEY'
)
]) {
sh './gradlew --no-daemon --parallel publish'
if (version ==~ /.*-SNAPSHOT/) { // Only publish snapshots to Azure
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
stage(stage_name + 'Publish') {
withCredentials([
usernamePassword(
credentialsId: 'hyperledger-azure',
usernameVariable: 'AZURE_USER',
passwordVariable: 'AZURE_KEY'
)
]) {
sh './gradlew --no-daemon --parallel publish'
}
}
}
}

Loading…
Cancel
Save