Skip to content

Commit

Permalink
Fix manifest docker not skipping interim builds for RCs (hyperledger#…
Browse files Browse the repository at this point in the history
…5068)

Signed-off-by: Jason Frame <jason.frame@consensys.net>
  • Loading branch information
jframe authored and elenduuche committed Aug 16, 2023
1 parent add5064 commit d1a97fe
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,7 @@ task dockerUpload {
additionalTags.add('develop')
}

def isInterimBuild = (dockerBuildVersion ==~ /.*-SNAPSHOT/) || (dockerBuildVersion ==~ /.*-alpha/)
|| (dockerBuildVersion ==~ /.*-beta/) || (dockerBuildVersion ==~ /.*-RC.*/)

if (!isInterimBuild) {
if (!isInterimBuild(dockerBuildVersion)) {
additionalTags.add(dockerBuildVersion.split(/\./)[0..1].join('.'))
}

Expand Down Expand Up @@ -778,7 +775,7 @@ task manifestDocker {
tags.add("${dockerImageName}:develop")
}

if (!(dockerBuildVersion ==~ /.*-SNAPSHOT/)) {
if (!isInterimBuild(dockerBuildVersion)) {
tags.add("${dockerImageName}:" + dockerBuildVersion.split(/\./)[0..1].join('.'))
}

Expand Down Expand Up @@ -929,6 +926,12 @@ def getCheckedOutGitCommitHash(length = 8) {
}
}

// Takes the version and if it contains SNAPSHOT, alpha, beta or RC in version then return true indicating an interim build
def isInterimBuild(dockerBuildVersion) {
return (dockerBuildVersion ==~ /.*-SNAPSHOT/) || (dockerBuildVersion ==~ /.*-alpha/)
|| (dockerBuildVersion ==~ /.*-beta/) || (dockerBuildVersion ==~ /.*-RC.*/)
}

tasks.register("verifyDistributions") {
dependsOn distTar
dependsOn distZip
Expand Down

0 comments on commit d1a97fe

Please sign in to comment.