Skip to content

Commit

Permalink
Fix docker tags (#60)
Browse files Browse the repository at this point in the history
* fixing the regex to publish to bintray

Signed-off-by: Joshua Fernandes <joshua.fernandes@consensys.net>
  • Loading branch information
joshuafernandes authored Sep 29, 2019
1 parent 1ca8487 commit f68a1cd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ def shouldPublish() {
return env.BRANCH_NAME == 'master' || env.BRANCH_NAME ==~ /^release-\d+\.\d+/
}

def isSnapshotVersion(v) {
return (v ==~ /.*-SNAPSHOT/)
}

if (shouldPublish()) {
properties([
buildDiscarder(
Expand Down Expand Up @@ -236,8 +240,7 @@ exit $status
if (env.BRANCH_NAME == 'master') {
additionalTags.add('develop')
}

if (! version ==~ /.*-SNAPSHOT/) {
if (! isSnapshotVersion(version)) {
additionalTags.add('latest')
additionalTags.add(version.split(/\./)[0..1].join('.'))
}
Expand Down Expand Up @@ -266,7 +269,7 @@ exit $status
}

// we dont publish snapshots to bintray
if (! (version ==~ /.*-SNAPSHOT/)) {
if (! isSnapshotVersion(version)) {

stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
Expand Down Expand Up @@ -303,7 +306,7 @@ exit $status
version = gradleProperties.version
}

if (version ==~ /.*-SNAPSHOT/) { // Only publish snapshots to Azure
if (isSnapshotVersion(version)) { // Only publish snapshots to Azure
stage(stage_name + 'Prepare') {
sh './gradlew --no-daemon --parallel clean assemble'
}
Expand Down

0 comments on commit f68a1cd

Please sign in to comment.