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 b34fa2b commit e502c54
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 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()
projectVersion = getProjectVersion(false)
dir(getRepoName()) {
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
githubscm.tagRepository(projectVersion)
Expand Down Expand Up @@ -281,7 +281,7 @@ String getDeployImageNameSuffix() {
return params.IMAGE_NAME_SUFFIX
}
String getDeployImageTag() {
return getProjectVersion()
return getBuildBranch() + "-" + getProjectVersionDate()
}

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

0 comments on commit e502c54

Please sign in to comment.