From b34fa2b1fba470ec4e29e522422c01a7f5cbed69 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Fri, 19 Jul 2024 11:20:52 -0300 Subject: [PATCH 1/2] Set 10.0.x-YYYYMMDD image tags on weekly deploy job --- .ci/jenkins/Jenkinsfile.weekly.deploy | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index fd03c959b..e5e75821b 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -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) @@ -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') { @@ -281,7 +281,7 @@ String getDeployImageNameSuffix() { return params.IMAGE_NAME_SUFFIX } String getDeployImageTag() { - return getProjectVersion(false) + return getProjectVersion() } boolean isDeployLatestTag() { @@ -346,10 +346,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() } From e502c548402d1d5bf66ca3b5eac150c663087758 Mon Sep 17 00:00:00 2001 From: Rodrigo Antunes Date: Fri, 19 Jul 2024 11:22:08 -0300 Subject: [PATCH 2/2] Set 10.0.x-YYYYMMDD image tags on weekly deploy job --- .ci/jenkins/Jenkinsfile.weekly.deploy | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.weekly.deploy b/.ci/jenkins/Jenkinsfile.weekly.deploy index e5e75821b..abf7109b6 100644 --- a/.ci/jenkins/Jenkinsfile.weekly.deploy +++ b/.ci/jenkins/Jenkinsfile.weekly.deploy @@ -126,7 +126,7 @@ pipeline { stage('Create and push a new tag') { steps { script { - projectVersion = getProjectVersion() + projectVersion = getProjectVersion(false) dir(getRepoName()) { githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.tagRepository(projectVersion) @@ -281,7 +281,7 @@ String getDeployImageNameSuffix() { return params.IMAGE_NAME_SUFFIX } String getDeployImageTag() { - return getProjectVersion() + return getBuildBranch() + "-" + getProjectVersionDate() } boolean isDeployLatestTag() { @@ -346,6 +346,10 @@ String getProjectVersionDate() { return projectVersionDate.replace('-', '') } -String getProjectVersion() { - return env.PROJECT_VERSION + getProjectVersionDate() +String getProjectVersion(boolean keepSnapshotSuffix = true) { + def projectVersion = env.PROJECT_VERSION + if (keepSnapshotSuffix) { + return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}-SNAPSHOT") + } + return projectVersion.replace("-SNAPSHOT", "-${getProjectVersionDate()}") }