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

[10.0.x] NO-ISSUE: Fix weekly image tags #1797

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
18 changes: 5 additions & 13 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 @@ -212,7 +212,7 @@ void createBuildAndTestStageClosure(String image) {
buildParams.add(string(name: 'DEPLOY_IMAGE_NAMESPACE', value: getDeployImageNamespace()))
buildParams.add(string(name: 'DEPLOY_IMAGE_NAME_SUFFIX', value: getDeployImageNameSuffix()))
buildParams.add(string(name: 'DEPLOY_IMAGE_TAG', value: getDeployImageTag()))
buildParams.add(booleanParam(name: 'DEPLOY_WITH_LATEST_TAG', value: isDeployLatestTag()))
buildParams.add(booleanParam(name: 'DEPLOY_WITH_LATEST_TAG', value: false))

def job = build(job: 'kogito-images.build-image', wait: true, parameters: buildParams, propagate: false)
if (job.result != 'SUCCESS') {
Expand Down Expand Up @@ -281,11 +281,7 @@ String getDeployImageNameSuffix() {
return params.IMAGE_NAME_SUFFIX
}
String getDeployImageTag() {
return getProjectVersion(false)
}

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