Skip to content

Commit

Permalink
KOGITO-9706: more robustness in post-release job
Browse files Browse the repository at this point in the history
  • Loading branch information
mbiarnes committed Aug 14, 2023
1 parent 2e3cf55 commit 1a44f6b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
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"))
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'
}
}
}
}
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')
}
}
}

0 comments on commit 1a44f6b

Please sign in to comment.