Skip to content

Commit

Permalink
Fix weekly image tags (#1798)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull authored Aug 26, 2024
1 parent 38632d2 commit 475225a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .ci/jenkins/Jenkinsfile.build-image
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ pipeline {
int retries = Integer.parseInt(env.MAX_REGISTRY_RETRIES)
String imageTag = getBuiltImageTag()
if (isDeployLatestTag()) {
latestTag = getTriggeringProjectName().contains('weekly') ? 'weekly-latest' : 'latest'
latestTag = 'latest'
cloud.skopeoCopyRegistryImages(imageTag, getBuiltImageTag(latestTag), retries)
}
}
Expand Down
16 changes: 4 additions & 12 deletions .ci/jenkins/Jenkinsfile.weekly.deploy
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ pipeline {
stage('Create and push a new tag') {
steps {
script {
projectVersion = getProjectVersion(false)
projectVersion = getProjectVersion()
dir(getRepoName()) {
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.tagRepository(projectVersion)
Expand Down Expand Up @@ -281,11 +281,7 @@ String getDeployImageNameSuffix() {
return params.IMAGE_NAME_SUFFIX
}
String getDeployImageTag() {
return getBuildBranch() + "-" + getProjectVersionDate()
}

boolean isDeployLatestTag() {
return params.DEPLOY_WITH_LATEST_TAG
return getProjectVersion()
}

////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -346,10 +342,6 @@ String getProjectVersionDate() {
return projectVersionDate.replace('-', '')
}

String getProjectVersion(boolean keepSnapshotSuffix = true) {
def projectVersion = env.PROJECT_VERSION
if (keepSnapshotSuffix) {
return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}-SNAPSHOT")
}
return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}")
String getProjectVersion() {
return env.PROJECT_VERSION + '-' + getProjectVersionDate()
}

0 comments on commit 475225a

Please sign in to comment.