Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KOGITO-9706: more robustness in post-release job #4510

Open
wants to merge 1 commit into
base: main-kogito
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions .ci/jenkins/Jenkinsfile.kie-kogito-post-release
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ pipeline {
steps {
script {
dir("${docsRepo}/doc-content/kogito-docs") {
if (githubscm.isTagExist('origin', "${getKogitoDocsVersion()}-kogito")) {
githubscm.removeRemoteTag('origin', "${getKogitoDocsVersion()}-kogito", getGitAuthorCredsId())
}
githubscm.removeLocalTag("${getKogitoDocsVersion()}-kogito"))
Comment on lines +98 to +101

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (githubscm.isTagExist('origin', "${getKogitoDocsVersion()}-kogito")) {
githubscm.removeRemoteTag('origin', "${getKogitoDocsVersion()}-kogito", getGitAuthorCredsId())
}
githubscm.removeLocalTag("${getKogitoDocsVersion()}-kogito"))
if (githubscm.isTagExist('origin', "${getKogitoDocsVersion()}-kogito")) {
githubscm.removeRemoteTag('origin', "${getKogitoDocsVersion()}-kogito", getGitAuthorCredsId())
githubscm.removeLocalTag("${getKogitoDocsVersion()}-kogito"))
}

githubscm.tagRepository("${getKogitoDocsVersion()}-kogito")
}
}
Expand Down Expand Up @@ -124,6 +128,9 @@ pipeline {
}
}
stage('Upload kie-kogito-docs to filemgmt') {
when {
expression {!isSkipUpload()}
}
steps {
sshagent(credentials: ['KogitoDocsUpload']) {
script {
Expand All @@ -134,15 +141,25 @@ pipeline {
}
}
}
stage('Bump up kie-kogito-docs to next SNAPSHOT'){
stage('Bump up kogito-docs to next SNAPSHOT'){
steps{
dir("${docsRepo}/doc-content/kogito-docs") {
script{
maven.mvnVersionsSet(util.getNextVersion(getKogitoDocsVersion(), 'minor'))
if ( isNewVersionRequired() ) {
// bump up if the current kie-version on main branch is greater then the kie-version on main-kogito branch
maven.mvnVersionsUpdateParentAndChildModules("${getKieVersion()}", true)
}
sh 'head -n30 pom.xml'
mbiarnes marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
}
stage('Bump up kie-version if required') {
when {
expression {isNewVersionRequired()}
}
steps {
script {
dir("${docsRepo}") {
// bump up if the current kie-version on main branch is greater then the kie-version on main-kogito branch
maven.mvnVersionsUpdateParentAndChildModules("${getKieVersion()}", true)
sh 'head -n30 pom.xml'
}
}
Expand Down Expand Up @@ -220,6 +237,10 @@ boolean isNewVersionRequired() {
return params.BUMP_UP
}

boolean isSkipUpload() {
return params.SKIP_UPLOAD
}

String getGitAuthorCredsId() {
return env.GIT_AUTHOR_CREDENTIALS_ID
}
Expand Down
3 changes: 2 additions & 1 deletion .ci/jenkins/dsl/jobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ void setupKogitoDocsJob() {
stringParam('KOGITO_RELEASE_NUMBER', '12409824', 'Jira release notes number of kogito release')
stringParam('TOOLING_RELEASE_NUMBER', '12409093', 'Jira release notes number of kogito-tooling')
stringParam('KOGITO_TOOLING_VERSION', '0.30.0', 'Kogito-tooling version to use as Major.minor.micro')
booleanParam('BUMP_UP' , false, 'Is a new KIE version needed?')
booleanParam('BUMP_UP' , false, 'Please check only if a new KIE version needed')
stringParam('KIE_VERSION' , '', 'KIE version to bump up to as Major.minor.micro-SNAPSHOT')
booleanParam('SKIP_UPLOAD' , false, 'Please check only if the step for uploading the docs to filemgmt should be skipped')
}
}
}