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 9c72a6a  SLING-7597 - Investigate setting up Windows testing
9c72a6a is described below

commit 9c72a6aa6dc739ca6d71c4518dedb43eb1e11a2c
Author: Robert Munteanu <[email protected]>
AuthorDate: Wed Feb 27 09:51:54 2019 +0100

    SLING-7597 - Investigate setting up Windows testing
    
    Use runCmd method instead of $shellStep, Jenkinsfile does not accept
    that kind of syntax.
---
 Jenkinsfile | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index f4a3e2f..662ed1d 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -14,13 +14,12 @@ node('ubuntu') {
 // generates os-specific stages
 def generateStages(String os, def mvnVersion, def javaVersion) {
     def prefix = os == "windows" ? "win" : "linux"
-    def shellStep = os == "windows" ? "bat" : "script"
 
     def stages = {
         stage("[$prefix] Build shared code") {
             withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
                 timeout(10) {
-                    $shellStep  "mvn -f shared/modules clean install"
+                    runCmd "mvn -f shared/modules clean install"
                 }
             }
         }
@@ -28,7 +27,7 @@ def generateStages(String os, def mvnVersion, def 
javaVersion) {
         stage("[$prefix] Build CLI bundles") {
             withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
                 timeout(10) {
-                    $shellStep "mvn -f cli clean install"
+                    runCmd "mvn -f cli clean install"
                 }
             }
         }
@@ -36,7 +35,7 @@ def generateStages(String os, def mvnVersion, def 
javaVersion) {
         stage ("[$prefix] Build shared code P2 repository") {
             withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
                 timeout(10) {
-                    $shellStep 'mvn -f shared/p2 clean package'
+                    runCmd 'mvn -f shared/p2 clean package'
                 }
             }
         }
@@ -45,7 +44,7 @@ def generateStages(String os, def mvnVersion, def 
javaVersion) {
             withMaven(maven: mvnVersion, jdk: javaVersion, options: 
[artifactsPublisher(disabled: true)]) {
                 timeout(20) {
                     wrap([$class: 'Xvfb']) {
-                        $shellStep 'mvn -f eclipse clean verify -Ddebug'
+                        runCmd 'mvn -f eclipse clean verify -Ddebug'
                     }
                     // workaround for 
https://issues.jenkins-ci.org/browse/JENKINS-55889
                     junit 'eclipse/**/surefire-reports/*.xml' 
@@ -62,4 +61,12 @@ def generateStages(String os, def mvnVersion, def 
javaVersion) {
     }
 
     return stages
+}
+
+def runCmd(def cmd) {
+    if (isUnix() ) {
+        shell cmd
+    } else {
+        bat cmd
+    }
 }
\ No newline at end of file

Reply via email to