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

rombert pushed a commit to branch feature/SLING-7597
in repository https://gitbox.apache.org/repos/asf/sling-ide-tooling.git


The following commit(s) were added to refs/heads/feature/SLING-7597 by this 
push:
     new f4c0d8a  SLING-7597 - Investigate setting up Windows testing
f4c0d8a is described below

commit f4c0d8a88aa17429a309e9b0d3f8f300f0cbf29e
Author: Robert Munteanu <[email protected]>
AuthorDate: Wed Feb 27 13:38:13 2019 +0100

    SLING-7597 - Investigate setting up Windows testing
    
    Try and fix problem with ubuntu executions not finding the SCM checkout.
---
 Jenkinsfile | 82 +++++++++++++++++++++++++++++++++----------------------------
 1 file changed, 44 insertions(+), 38 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index eb87b3a..4f084bb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -14,58 +14,64 @@ node('ubuntu') {
 // generates os-specific stages
 def generateStages(String os, def mvnVersion, def javaVersion) {
     def prefix = os == "windows" ? "win" : "linux"
-    def nodeLabel = os == "windows" ? "Windows" : "ubuntu"
 
-    def stages = {
-        node(nodeLabel) {
-            stage("[$prefix] Build shared code") {
-                withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
-                    timeout(10) {
-                        runCmd "mvn -f shared/modules clean install"
-                    }
+    def stages = [
+        stage("[$prefix] Build shared code") {
+            withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
+                timeout(10) {
+                    runCmd "mvn -f shared/modules clean install"
                 }
             }
-
-            stage("[$prefix] Build CLI bundles") {
-                withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
-                    timeout(10) {
-                        runCmd "mvn -f cli clean install"
-                    }
+        },
+        stage("[$prefix] Build CLI bundles") {
+            withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
+                timeout(10) {
+                    runCmd "mvn -f cli clean install"
                 }
             }
-
-            stage ("[$prefix] Build shared code P2 repository") {
-                withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
-                    timeout(10) {
-                        runCmd 'mvn -f shared/p2 clean package'
-                    }
+        },
+        stage ("[$prefix] Build shared code P2 repository") {
+            withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
+                timeout(10) {
+                    runCmd 'mvn -f shared/p2 clean package'
                 }
             }
-
-            stage ("[$prefix] Build Eclipse plug-ins") {
-                withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
-                    timeout(20) {
-                        if ( isUnix() ) {
-                            wrap([$class: 'Xvfb']) {
-                                sh 'mvn -f eclipse clean verify -Ddebug'
-                            }
-                        } else {
-                            try {
-                                bat 'mvn -f eclipse clean verify -Ddebug'
-                            } catch (ignored) {
-                                echo "Ignoring Windows failure for now: 
${e.message}"
-                            }
+        },
+        stage ("[$prefix] Build Eclipse plug-ins") {
+            withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
+                timeout(20) {
+                    if ( isUnix() ) {
+                        wrap([$class: 'Xvfb']) {
+                            sh 'mvn -f eclipse clean verify -Ddebug'
+                        }
+                    } else {
+                        try {
+                            bat 'mvn -f eclipse clean verify -Ddebug'
+                        } catch (ignored) {
+                            echo "Ignoring Windows failure for now: 
${e.message}"
                         }
-                        // workaround for 
https://issues.jenkins-ci.org/browse/JENKINS-55889
-                        junit 'eclipse/**/surefire-reports/*.xml' 
-                        archiveArtifacts artifacts: 'eclipse/**/logs/*.log'
                     }
+                    // workaround for 
https://issues.jenkins-ci.org/browse/JENKINS-55889
+                    junit 'eclipse/**/surefire-reports/*.xml' 
+                    archiveArtifacts artifacts: 'eclipse/**/logs/*.log'
                 }
             }
         }
+    ]
+
+    // avoid wrapping Linux nodes again in node() context since that seems to 
make the 
+    // SCM checkout unavailable
+    if ( os == "windows ") {
+        return {
+            node("Windows") {
+                stages*.call()
+            }
+        }
     }
 
-    return stages
+    return {
+        stages*.call()
+    }
 }
 
 def runCmd(def cmd) {

Reply via email to