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/21 07:06:37 UTC

[sling-tooling-jenkins] branch bugfix/isolate-workspaces created (now 20af77b)

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

kwin pushed a change to branch bugfix/isolate-workspaces
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git


      at 20af77b  SLING-11401 properly isolate workspace directories

This branch includes the following new commits:

     new 20af77b  SLING-11401 properly isolate workspace directories

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.



[sling-tooling-jenkins] 01/01: SLING-11401 properly isolate workspace directories

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

kwin pushed a commit to branch bugfix/isolate-workspaces
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git

commit 20af77b1afbb82d0c562668f43ef9be02d24eb10
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Tue Jun 21 09:06:31 2022 +0200

    SLING-11401 properly isolate workspace directories
---
 vars/slingOsgiBundleBuild.groovy | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index c7b4488..1c0e4d3 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -78,7 +78,7 @@ def call(Map params = [:]) {
                 if ( isReferenceStage ) {
                     referenceJdkVersion = jdkVersion
                 }
-                stepsMap["Build (Java ${jdkVersion})"] = stageDefinition.call()
+                stepsMap["Build (Java ${jdkVersion})"] = stageDefinition
                 isReferenceStage = false
                 currentBuild.result = "SUCCESS"
             }
@@ -178,8 +178,11 @@ def defineStage(def globalConfig, def jobConfig, def jdkVersion, boolean isRefer
     def branchConfig = jobConfig?.branches?."$env.BRANCH_NAME" ?: [:]
 
     return {
-        wrapInNode(branchConfig.nodeLabel ?: globalConfig.mainNodeLabel, {
+        node(nodeLabel: branchConfig.nodeLabel ?: globalConfig.mainNodeLabel,
+            customWorkspace: jenkinsJdkLabel // isolate parallel builds on same node
+            ) {
             timeout(time: 30, unit: 'MINUTES') {
+                checkout scm
                 stage("Maven Build (Java ${jdkVersion}, ${goal})") {
                     echo "Running on node ${env.NODE_NAME}"
                     invocation.call()
@@ -278,12 +281,3 @@ boolean getShouldDeploy() {
 boolean isOnMainBranch() {
     return env.BRANCH_NAME == 'master'
 }
-
-def wrapInNode(def nodeLabel, Closure invocation) {
-    return {
-        node(nodeLabel) {
-            checkout scm
-            invocation.call()
-        }
-    }
-}