From 92c92ee96c49b97abbdc04e60fcef72f3b7afbcc Mon Sep 17 00:00:00 2001 From: Loredana Crusoveanu Date: Thu, 14 Dec 2017 22:24:31 +0200 Subject: [PATCH] fix windows jenkins script --- .../scripted-pipeline-unix-nonunix | 31 +++++-------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/spring-jenkins-pipeline/scripted-pipeline-unix-nonunix b/spring-jenkins-pipeline/scripted-pipeline-unix-nonunix index 6b775b6e56..e9cae64d3d 100644 --- a/spring-jenkins-pipeline/scripted-pipeline-unix-nonunix +++ b/spring-jenkins-pipeline/scripted-pipeline-unix-nonunix @@ -14,8 +14,10 @@ node { stage("Checkstyle") { if (isUnix()) { sh "./mvnw checkstyle:checkstyle" - - step([$class: 'CheckStylePublisher', + } else { + bat "./mvnw.cmd checkstyle:checkstyle" + } + step([$class: 'CheckStylePublisher', canRunOnFailed: true, defaultEncoding: '', healthy: '100', @@ -23,18 +25,6 @@ node { unHealthy: '90', useStableBuildAsReference: true ]) - } else { - bat "./mvnw.cmd checkstyle:checkstyle" - - step([$class: 'CheckStylePublisher', - canRunOnFailed: true, - defaultEncoding: '', - healthy: '100', - pattern: '**\target\checkstyle-result.xml', - unHealthy: '90', - useStableBuildAsReference: true - ]) - } } } } @@ -44,32 +34,27 @@ node { stage("Runing unit tests") { if (isUnix()) { sh "./mvnw test -Punit" - - step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*UnitTest.xml']) } else { bat "./mvnw.cmd test -Punit" - - step([$class: 'JUnitResultArchiver', testResults: '**\target\surefire-reports\TEST-*UnitTest.xml']) } + step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*UnitTest.xml']) + } }, 'Integration tests': { stage("Runing integration tests") { if (isUnix()) { sh "./mvnw test -Pintegration" - - step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*IntegrationTest.xml']) } else { bat "./mvnw.cmd test -Pintegration" - - step([$class: 'JUnitResultArchiver', testResults: '**\target\surefire-reports\TEST-*IntegrationTest.xml']) } + step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*IntegrationTest.xml']) } }, 'Deployment': { stage("Staging") { if (isUnix()) { sh "pid=\$(lsof -i:8989 -t); kill -TERM \$pid || kill -KILL \$pid" } else { - bat "FOR /F 'tokens=5 delims= ' %%P IN ('netstat -ano ^| findstr :8989') DO TaskKill.exe /PID %%P" + bat "FOR /F \"tokens=5 delims= \" %%G IN (\"netstat -a | findstr :8989\") DO TaskKill.exe /PID %%G /fi \"memusage gt 0\"" } withEnv(['JENKINS_NODE_COOKIE=dontkill']) {