diff --git a/.ci/jenkins/Jenkinsfile.build-image b/.ci/jenkins/Jenkinsfile.build-image index 683fd60d9..2f96db358 100644 --- a/.ci/jenkins/Jenkinsfile.build-image +++ b/.ci/jenkins/Jenkinsfile.build-image @@ -208,7 +208,7 @@ pipeline { } steps { script { - def resultingFileName = "incubator-kie-${getImageArtifactReleaseVersion()}-${getBuildImageName()}.tar.gz" + def resultingFileName = "incubator-kie-${getImageArtifactReleaseVersion()}-${getBuildImageName()}-image.tar.gz" def signatureFileName = "${resultingFileName}.asc" sh """ docker pull ${getBuiltImageTag()} diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index a6e20a773..c43854363 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -18,8 +18,6 @@ deployProperties = [:] -changesDone = false - BUILT_IMAGES = Collections.synchronizedList([]) BUILD_FAILED_IMAGES = Collections.synchronizedList([]) TEST_FAILED_IMAGES = Collections.synchronizedList([]) @@ -73,22 +71,6 @@ pipeline { } } - stage('Prepare for PR') { - when { - expression { return isRelease() } - } - steps { - script { - dir(getRepoName()) { - if (githubscm.isBranchExist('origin', getPRBranch())) { - githubscm.removeRemoteBranch('origin', getPRBranch(), getGitAuthorPushCredsId()) - } - githubscm.createBranch(getPRBranch()) - } - } - } - } - stage('Setup Quarkus platform version') { when { expression { isRelease() } @@ -124,7 +106,7 @@ pipeline { } sh versionCmd - commitAndPushChanges("Update project version to ${getProjectVersion()}") + commitAndTagChanges("[${getBuildBranch()}] Update version to ${getProjectVersion()}") } } } @@ -172,67 +154,6 @@ pipeline { } } } - - stage('Create PR') { - when { - expression { - return changesDone && isRelease() - } - } - steps { - script { - dir(getRepoName()) { - def commitMsg = "[${getBuildBranch()}] Update Maven artifacts" - def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}." - if (isRelease()) { - commitMsg = "[${getBuildBranch()}] Update project version to ${getProjectVersion()}" - prBody += '\nPlease do not merge, it should be merged automatically.' - } else if (currentBuild.currentResult != 'SUCCESS') { - commitMsg += " (${currentBuild.currentResult})" - prBody += '\n\nSuccessful images:\n' - getBuiltImages().each { - prBody += "- ${it}\n" - } - if (getBuildFailedImages()) { - prBody += '\nBuild failures on those images:\n' - getBuildFailedImages().each { - prBody += "- ${it}\n" - } - } else { - prBody += '\nImages were all successfully built but some other problem occured in the pipeline execution...\n' - } - if (getTestFailedImages()) { - prBody += '\nTest failures on those images:\n' - getTestFailedImages().each { - prBody += "- ${it}\n" - } - } else { - prBody += '\nImages were all successfully built but some other problem occured in the pipeline execution...\n' - } - prBody += '\nSee build url above for more information' - } - String prLink = githubscm.createPR(commitMsg, prBody, getBuildBranch(), getGitAuthorPushCredsId()) - deployProperties["${getRepoName()}.pr.link"] = prLink - - // Create a new tag - githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) - githubscm.tagRepository(getGitTagName()) - githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) - } - } - } - post { - always { - script { - setDeployPropertyIfNeeded("${getRepoName()}.pr.source.uri", "https://github.com/${getGitAuthor()}/${getRepoName()}") - setDeployPropertyIfNeeded("${getRepoName()}.pr.source.ref", getPRBranch()) - setDeployPropertyIfNeeded("${getRepoName()}.pr.target.uri", "https://github.com/${getGitAuthor()}/${getRepoName()}") - setDeployPropertyIfNeeded("${getRepoName()}.pr.target.ref", getBuildBranch()) - setDeployPropertyIfNeeded("${getRepoName()}.tag.name", getGitTagName()) - } - } - } - } stage('Finalize') { steps { script { @@ -283,11 +204,11 @@ void checkoutRepo() { checkout(githubscm.resolveRepository(getRepoName(), getGitAuthor(), getBuildBranch(), false, getGitAuthorCredsId())) } -void commitAndPushChanges(String commitMsg) { +void commitAndTagChanges(String commitMsg) { githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.commitChanges(commitMsg) - githubscm.pushObject('origin', getPRBranch(), getGitAuthorPushCredsId()) - changesDone = true + githubscm.tagRepository(getGitTagName()) + githubscm.pushRemoteTag('origin', getGitTagName(), getGitAuthorPushCredsId()) } void createBuildAndTestStageClosure(String image) { @@ -363,7 +284,7 @@ List getTestFailedImages() { //////////////////////////////////////////////////////////////////////// boolean isDeployImage() { - return !Boolean.valueOf(env.DISABLE_IMAGES_DEPLOY) + return !env.DISABLE_IMAGES_DEPLOY } boolean isDeployImageInOpenshiftRegistry() {