From 9d33fda0d0a281f9d88cb6fa6ce0924f8ade8df2 Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Wed, 11 Dec 2019 10:26:32 +1000 Subject: [PATCH] fixing the docker tags version (#248) Signed-off-by: Joshua Fernandes --- build.gradle | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 1a3dcb6ef7..185878fcdd 100644 --- a/build.gradle +++ b/build.gradle @@ -531,7 +531,8 @@ tasks.register("dockerDistUntar") { task distDocker(type: Exec) { dependsOn dockerDistUntar def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}" - def image = project.hasProperty('release.releaseVersion') ? "hyperledger/besu:" + project.property('release.releaseVersion') : "hyperledger/besu:${project.version}" + def imageName = "hyperledger/besu" + def image = "${imageName}:${dockerBuildVersion}" def dockerBuildDir = "build/docker-besu/" workingDir "${dockerBuildDir}" @@ -562,9 +563,10 @@ task testDocker(type: Exec) { task dockerUpload(type: Exec) { dependsOn distDocker + def dockerBuildVersion = project.hasProperty('release.releaseVersion') ? project.property('release.releaseVersion') : "${rootProject.version}" def imageName = "hyperledger/besu" def azureImageName = "hyperledger.azurecr.io/besu" - def image = project.hasProperty('release.releaseVersion') ? "${imageName}:" + project.property('release.releaseVersion') : "${imageName}:${project.version}" + def image = "${imageName}:${dockerBuildVersion}" def cmd = "docker push '${image}'" def additionalTags = [] @@ -572,9 +574,9 @@ task dockerUpload(type: Exec) { additionalTags.add('develop') } - if (! version ==~ /.*-SNAPSHOT/) { + if (!(dockerBuildVersion ==~ /.*-SNAPSHOT/)) { additionalTags.add('latest') - additionalTags.add(version.split(/\./)[0..1].join('.')) + additionalTags.add(dockerBuildVersion.split(/\./)[0..1].join('.')) } additionalTags.each { tag ->