Skip to content

Commit

Permalink
Fix promote pipeline (#238)
Browse files Browse the repository at this point in the history
* Fix promote pipeline (#237)

* Update Jenkinsfile.promote

* Update Jenkinsfile.promote

---------

Co-authored-by: Tristan Radisson <[email protected]>
  • Loading branch information
github-actions[bot] and radtriste authored Aug 22, 2023
1 parent 12879f7 commit 32dcd71
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pipeline {
}
}
}
stage('Merge PR, tag and release CLI') {
stage('Merge PR and create tags') {
when {
expression { return helper.isRelease() }
}
Expand Down Expand Up @@ -122,16 +122,18 @@ pipeline {
stage('Create Release') {
steps {
script {
if(githubscm.isReleaseExist(helper.getGitTag(), helper.getGitAuthorCredsID())) {
githubscm.deleteReleaseAndTag(helper.getGitTag(), helper.getGitAuthorCredsID())
}
githubscm.createReleaseWithGeneratedReleaseNotes(helper.getGitTag(), helper.getBuildBranch(), githubscm.getPreviousTagFromVersion(helper.getGitTag(), 'v', '', ['/']), helper.getGitAuthorCredsID())
githubscm.updateReleaseBody(helper.getGitTag(), helper.getGitAuthorCredsID())

withCredentials([usernamePassword(credentialsId: helper.getGitAuthorCredsID(), usernameVariable: 'GH_USER', passwordVariable: 'GH_TOKEN')]) {
sh """
gh release upload ${helper.getGitTag()} "operator.yaml"
"""
dir(helper.getRepoName()) {
if(githubscm.isReleaseExist(helper.getGitTag(), helper.getGitAuthorCredsID())) {
githubscm.deleteReleaseAndTag(helper.getGitTag(), helper.getGitAuthorCredsID())
}
githubscm.createReleaseWithGeneratedReleaseNotes(helper.getGitTag(), helper.getBuildBranch(), githubscm.getPreviousTagFromVersion(helper.getProjectVersion(), 'v', '', ['/']), helper.getGitAuthorCredsID())
githubscm.updateReleaseBody(helper.getGitTag(), helper.getGitAuthorCredsID())

withCredentials([usernamePassword(credentialsId: helper.getGitAuthorCredsID(), usernameVariable: 'GH_USER', passwordVariable: 'GH_TOKEN')]) {
sh """
gh release upload ${helper.getGitTag()} "operator.yaml"
"""
}
}
}
}
Expand Down

0 comments on commit 32dcd71

Please sign in to comment.