You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2022/06/15 10:15:30 UTC

[sling-tooling-jenkins] branch feature/parallel-builds updated (666de8a -> 1d91438)

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

kwin pushed a change to branch feature/parallel-builds
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git


 discard 666de8a  cleanup
     new 1d91438  cleanup

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (666de8a)
            \
             N -- N -- N   refs/heads/feature/parallel-builds (1d91438)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 vars/slingOsgiBundleBuild.groovy | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


[sling-tooling-jenkins] 01/01: cleanup

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/parallel-builds
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git

commit 1d9143846728e1169e3961f7152ad003599b7d86
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Wed Jun 15 12:04:06 2022 +0200

    cleanup
---
 vars/slingOsgiBundleBuild.groovy | 51 +++++++++++++++++++++-------------------
 1 file changed, 27 insertions(+), 24 deletions(-)

diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 8181b7e..851d28b 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -43,23 +43,21 @@ def call(Map params = [:]) {
         }
     }
 
-    if ( isOnMainBranch() ) {
-        node(globalConfig.mainNodeLabel) {
-            timeout(time:30, unit: 'MINUTES', activity: true) {
-                stage('Configure Job') {
-                    def upstreamProjectsCsv = jobConfig.upstreamProjects ?
-                        jsonArrayToCsv(jobConfig.upstreamProjects) : ''
-                    def jobTriggers = []
-                    if ( env.BRANCH_NAME == 'master' )
-                        jobTriggers.add(cron(jobConfig.rebuildFrequency))
-                    if ( upstreamProjectsCsv )
-                        jobTriggers.add(upstream(upstreamProjects: upstreamProjectsCsv, threshold: hudson.model.Result.SUCCESS))
-    
-                    properties([
-                        pipelineTriggers(jobTriggers),
-                        buildDiscarder(logRotator(numToKeepStr: '10'))
-                    ])
-                }
+    node(globalConfig.mainNodeLabel) {
+        timeout(time:30, unit: 'MINUTES', activity: true) {
+            stage('Configure Job') {
+                def upstreamProjectsCsv = jobConfig.upstreamProjects ?
+                    jsonArrayToCsv(jobConfig.upstreamProjects) : ''
+                def jobTriggers = []
+                if ( isOnMainBranch() )
+                    jobTriggers.add(cron(jobConfig.rebuildFrequency))
+                if ( upstreamProjectsCsv )
+                    jobTriggers.add(upstream(upstreamProjects: upstreamProjectsCsv, threshold: hudson.model.Result.SUCCESS))
+
+                properties([
+                    pipelineTriggers(jobTriggers),
+                    buildDiscarder(logRotator(numToKeepStr: '10'))
+                ])
             }
         }
     }
@@ -104,7 +102,7 @@ def call(Map params = [:]) {
             if ( shouldDeploy ) {
                 node(globalConfig.mainNodeLabel) {
                     stage("Deploy to Nexus") {
-                        deployToNexus()
+                        deployToNexus(globalConfig)
                     }
                 }
             }
@@ -147,7 +145,7 @@ def defineStage(def globalConfig, def jobConfig, def jdkVersion, boolean isRefer
             dir(localRepoPath) {
                 deleteDir()
             }
-            // main build with IT for properly calculating coverage
+            // deploy to local directory (all artifacts from a reactor)
             additionalMavenParams = "${additionalMavenParams} -DaltDeploymentRepository=snapshot-repo::default::file:${localRepoPath}"
         }
         withMaven(maven: globalConfig.mvnVersion, jdk: jenkinsJdkLabel,
@@ -164,7 +162,7 @@ def defineStage(def globalConfig, def jobConfig, def jdkVersion, boolean isRefer
             archiveArtifacts(artifacts: SlingJenkinsHelper.jsonArrayToCsv(jobConfig.archivePatterns), allowEmptyArchive: true)
         }
         if ( isReferenceStage && goal == "deploy" && shouldDeploy ) {
-            // Stash the build results so we can deploy them on another node
+            // Stash the build results from the local deployment directory so we can deploy them on another node
             stash name: 'local-snapshots-dir', includes: 'local-snapshots-dir/**'
         }
     }
@@ -209,7 +207,7 @@ def analyseWithSonarCloud(def globalConfig, def jobConfig) {
     // Note: soon we won't have to handle that manually, see https://jira.sonarsource.com/browse/SONAR-11853
     if ( isPrBuild ) {
         sonarcloudParams="${sonarcloudParams} -Dsonar.pullrequest.branch=${CHANGE_BRANCH} -Dsonar.pullrequest.base=${CHANGE_TARGET} -Dsonar.pullrequest.key=${CHANGE_ID}"
-    } else if ( env.BRANCH_NAME != "master" ) {
+    } else if ( isOnMainBranch() ) {
         sonarcloudParams="${sonarcloudParams} -Dsonar.branch.name=${BRANCH_NAME}"
     }
     static final String SONAR_PLUGIN_GAV = 'org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184'
@@ -231,7 +229,7 @@ def analyseWithSonarCloud(def globalConfig, def jobConfig) {
     }
 }
 
-def deployToNexus() {
+def deployToNexus(def globalConfig) {
     node('nexus-deploy') {
         timeout(60) {
             echo "Running on node ${env.NODE_NAME}"
@@ -242,8 +240,13 @@ def deployToNexus() {
             // Unstash the previously stashed build results.
             unstash name: 'local-snapshots-dir'
             // https://www.mojohaus.org/wagon-maven-plugin/merge-maven-repos-mojo.html
-            String mavenArguments = "${wagonPluginGav}:merge-maven-repos -Dwagon.target=https://repository.apache.org/content/repositories/snapshots -Dwagon.targetId=apache.snapshots.https -Dwagon.source=file:${env.WORKSPACE}/local-snapshots-dir"
-            pipelineSupport.executeMaven(this, mavenArguments, false)
+            static final String WAGON_PLUGIN_GAV = "org.codehaus.mojo:wagon-maven-plugin:2.0.2"
+            String mavenArguments = "${WAGON_PLUGIN_GAV}:merge-maven-repos -Dwagon.target=https://repository.apache.org/content/repositories/snapshots -Dwagon.targetId=apache.snapshots.https -Dwagon.source=file:${env.WORKSPACE}/local-snapshots-dir"
+            withMaven(maven: globalConfig.mvnVersion,
+                     jdk: jenkinsJdkLabel(11, globalConfig),
+                     publisherStrategy: 'EXPLICIT') {
+                        sh "mvn ${mavenArguments}"
+            }
         }
     }
 }