This is an automated email from the ASF dual-hosted git repository.

rantunes pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-drools.git


The following commit(s) were added to refs/heads/main by this push:
     new 4ca282ed5f NO-ISSUE: Jenkins jobs updates and fixes for Apache 10 
release (#6087)
4ca282ed5f is described below

commit 4ca282ed5f1f62aab7570a9c46c81bf7ac780fa9
Author: Rodrigo Antunes <[email protected]>
AuthorDate: Mon Oct 7 16:01:15 2024 -0300

    NO-ISSUE: Jenkins jobs updates and fixes for Apache 10 release (#6087)
    
    * NO-ISSUE: Fix release configuration keys (#6045)
    
    * Fix release configuration keys
    
    * Fix release configuration keys
    
    * Rename release.groovy file to avoid conflicts with the RELEASE env var
    
    * Switch to GPG File Jenkins secret (#6046)
    
    * kie-issues#1397 - Adjust git tag creation for Apache 10 release (#6032)
    
    * Adjust git tag creation for Apache 10 release
    
    * Adjust git tag creation for Apache 10 release
    
    * Sync main -> 10.0.x
    
    ---------
    
    Co-authored-by: Rodrigo Antunes <[email protected]>
---
 .ci/jenkins/Jenkinsfile.deploy | 62 ++++++++++++++++++++++++++----------------
 .ci/jenkins/config/branch.yaml |  2 +-
 2 files changed, 39 insertions(+), 25 deletions(-)

diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy
index 9d95c6b324..4d4cca2928 100644
--- a/.ci/jenkins/Jenkinsfile.deploy
+++ b/.ci/jenkins/Jenkinsfile.deploy
@@ -26,7 +26,7 @@ deployProperties = [:]
 
 pipeline {
     agent {
-        docker { 
+        docker {
             image env.AGENT_DOCKER_BUILDER_IMAGE
             args env.AGENT_DOCKER_BUILDER_ARGS
             label util.avoidFaultyNodes()
@@ -82,12 +82,12 @@ pipeline {
         }
         stage('Prepare for PR') {
             when {
-                expression { return isRelease() || isCreatePr() }
+                expression { return isCreatePr() }
             }
             steps {
                 script {
                     dir(getRepoName()) {
-                        if (githubscm.isBranchExist('origin',getPRBranch())) {
+                        if (githubscm.isBranchExist('origin', getPRBranch())) {
                             githubscm.removeRemoteBranch('origin', 
getPRBranch(), getGitAuthorPushCredsId())
                         }
                         githubscm.createBranch(getPRBranch())
@@ -101,7 +101,7 @@ pipeline {
             }
             steps {
                 script {
-                    configFileProvider([configFile(fileId: 
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]){
+                    configFileProvider([configFile(fileId: 
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
                         maven.mvnVersionsSet(
                             
getMavenCommand().withSettingsXmlFile(MAVEN_SETTINGS_FILE),
                             getProjectVersion(),
@@ -127,20 +127,15 @@ pipeline {
                            .withProperty('maven.test.failure.ignore', true)
                            .skipTests(params.SKIP_TESTS)
 
-                        def Closure mavenRunClosure = {
-                            configFileProvider([configFile(fileId: 
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
-                                
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean 
$installOrDeploy")
-                            }
-                        }
-
                         if (isRelease()) {
-                            
release.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
+                            
releaseUtils.gpgImportKeyFromStringWithoutPassword(getReleaseGpgSignKeyCredsId())
                             mavenCommand
                             .withProfiles(['apache-release'])
                             .withProperty('only.reproducible')
-                            mavenRunClosure()
-                        } else {
-                            mavenRunClosure()
+                        }
+
+                        configFileProvider([configFile(fileId: 
env.MAVEN_SETTINGS_CONFIG_FILE_ID, variable: 'MAVEN_SETTINGS_FILE')]) {
+                            
mavenCommand.withSettingsXmlFile(MAVEN_SETTINGS_FILE).run("clean 
$installOrDeploy")
                         }
                     }
                 }
@@ -156,7 +151,7 @@ pipeline {
         }
         stage('Create PR') {
             when {
-                expression { return isRelease() || isCreatePr() }
+                expression { return isCreatePr() }
             }
             steps {
                 script {
@@ -180,6 +175,29 @@ pipeline {
                 }
             }
         }
+        stage('Commit and Create Tag') {
+            when {
+                expression { return isRelease() }
+            }
+            steps {
+                script {
+                    dir(getRepoName()) {
+                        if (githubscm.isThereAnyChanges()) {
+                            def commitMsg = "[${getBuildBranch()}] Update 
version to ${getProjectVersion()}"
+                            
githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId())
+                            githubscm.commitChanges(commitMsg, {
+                                
githubscm.findAndStageNotIgnoredFiles('pom.xml')
+                                
githubscm.findAndStageNotIgnoredFiles('antora.yml')
+                            })
+                        } else {
+                            println '[WARN] no changes to commit'
+                        }
+                        githubscm.tagRepository(getGitTagName())
+                        githubscm.pushRemoteTag('origin', getGitTagName(), 
getGitAuthorPushCredsId())
+                    }
+                }
+            }
+        }
     }
     post {
         always {
@@ -283,18 +301,10 @@ MavenCommand getMavenCommand(String directory = '') {
     def mvnCmd = new MavenCommand(this, ['-fae', '-ntp'])
                 .withOptions(env.BUILD_MVN_OPTS ? [ env.BUILD_MVN_OPTS ] : [])
                 .inDirectory(directory)
-    if (!isMainStream()) { // Workaround as enforcer rules may not be fixed on 
other streams
-        mvnCmd.withProperty('enforcer.skip')
-    } else {
-        mvnCmd.withProperty('full')
-    }
+                .withProperty('full')
     return mvnCmd
 }
 
-boolean isMainStream() {
-    return env.DROOLS_STREAM == 'main'
-}
-
 String getReleaseGpgSignKeyCredsId() {
     return env.RELEASE_GPG_SIGN_KEY_CREDS_ID
 }
@@ -302,3 +312,7 @@ String getReleaseGpgSignKeyCredsId() {
 String getReleaseGpgSignPassphraseCredsId() {
     return env.RELEASE_GPG_SIGN_PASSPHRASE_CREDS_ID
 }
+
+String getGitTagName() {
+    return params.GIT_TAG_NAME
+}
diff --git a/.ci/jenkins/config/branch.yaml b/.ci/jenkins/config/branch.yaml
index 59f7b1bac5..2c6c8eac17 100644
--- a/.ci/jenkins/config/branch.yaml
+++ b/.ci/jenkins/config/branch.yaml
@@ -98,7 +98,7 @@ cloud:
 release:
   gpg:
     sign:
-      key-credentials-id: 'GPG_KEY'
+      key-credentials-id: 'GPG_KEY_FILE'
       passphrase-credentials-id: ''
 jenkins:
   email_creds_id: DROOLS_CI_NOTIFICATION_EMAILS


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to