Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NO-ISSUE: Fix weekly image tags #1798

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
}
Loading