Skip to content

Commit

Permalink
Set 10.0.x-YYYYMMDD image tags on weekly deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigonull committed Jul 19, 2024
1 parent 9665943 commit b34fa2b
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 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,7 +281,7 @@ String getDeployImageNameSuffix() {
return params.IMAGE_NAME_SUFFIX
}
String getDeployImageTag() {
return getProjectVersion(false)
return getProjectVersion()
}

boolean isDeployLatestTag() {
Expand Down Expand Up @@ -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()
}

0 comments on commit b34fa2b

Please sign in to comment.