Skip to content

Commit

Permalink
KOGITO-9616 Improve release notes (#1642)
Browse files Browse the repository at this point in the history
* KOGITO-9616 Improve release notes

Similar to https://github.com/kiegroup/kogito-runtimes/pull/3017

* review comments
  • Loading branch information
radtriste authored Jul 26, 2023
1 parent c18f189 commit df75994
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions .ci/jenkins/Jenkinsfile.promote
Original file line number Diff line number Diff line change
Expand Up @@ -219,43 +219,11 @@ void makeQuayNewImagesPublic() {
}

void createRelease() {
if (isReleaseExist()) {
deleteRelease()
}

if (githubscm.isTagExist('origin', getGitTag())) {
githubscm.removeLocalTag(getGitTag())
githubscm.removeRemoteTag('origin', getGitTag(), getGitAuthorCredsID())
}

def releaseName = "Kogito Images Version ${getProjectVersion()}"
def description = params.RELEASE_NOTES ?: "We are glad to announce that the Kogito ${getProjectVersion()} release is now available!"
withCredentials([string(credentialsId: env.GITHUB_TOKEN_CREDS_ID, variable: 'GITHUB_TOKEN')]) {
sh """
export GITHUB_USER=${getGitAuthor()}
github-release release --tag ${getGitTag()} --target '${getBuildBranch()}' --name '${releaseName}' --description '${description}' --pre-release
"""
}
}

boolean isReleaseExist() {
releaseExistStatus = -1
withCredentials([string(credentialsId: env.GITHUB_TOKEN_CREDS_ID, variable: 'GITHUB_TOKEN')]) {
releaseExistStatus = sh(returnStatus: true, script: """
export GITHUB_USER=${getGitAuthor()}
github-release info --tag ${getGitTag()}
""")
}
return releaseExistStatus == 0
}

void deleteRelease() {
withCredentials([string(credentialsId: env.GITHUB_TOKEN_CREDS_ID, variable: 'GITHUB_TOKEN')]) {
sh """
export GITHUB_USER=${getGitAuthor()}
github-release delete --tag ${getGitTag()}
"""
if(githubscm.isReleaseExist(getGitTag(), getGitAuthorCredsID())) {
githubscm.deleteReleaseAndTag(getGitTag(), getGitAuthorCredsID())
}
githubscm.createReleaseWithGeneratedReleaseNotes(getGitTag(), getBuildBranch(), githubscm.getPreviousTag(getGitTag()), getGitAuthorCredsID())
githubscm.updateReleaseBody(getGitTag(), getGitAuthorCredsID())
}

String getOldImageFullTag(String imageName) {
Expand Down

0 comments on commit df75994

Please sign in to comment.