fix windows jenkins script
This commit is contained in:
parent
b2c31853a7
commit
92c92ee96c
|
@ -14,8 +14,10 @@ node {
|
||||||
stage("Checkstyle") {
|
stage("Checkstyle") {
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "./mvnw checkstyle:checkstyle"
|
sh "./mvnw checkstyle:checkstyle"
|
||||||
|
} else {
|
||||||
step([$class: 'CheckStylePublisher',
|
bat "./mvnw.cmd checkstyle:checkstyle"
|
||||||
|
}
|
||||||
|
step([$class: 'CheckStylePublisher',
|
||||||
canRunOnFailed: true,
|
canRunOnFailed: true,
|
||||||
defaultEncoding: '',
|
defaultEncoding: '',
|
||||||
healthy: '100',
|
healthy: '100',
|
||||||
|
@ -23,18 +25,6 @@ node {
|
||||||
unHealthy: '90',
|
unHealthy: '90',
|
||||||
useStableBuildAsReference: true
|
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") {
|
stage("Runing unit tests") {
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "./mvnw test -Punit"
|
sh "./mvnw test -Punit"
|
||||||
|
|
||||||
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*UnitTest.xml'])
|
|
||||||
} else {
|
} else {
|
||||||
bat "./mvnw.cmd test -Punit"
|
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': {
|
}, 'Integration tests': {
|
||||||
stage("Runing integration tests") {
|
stage("Runing integration tests") {
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "./mvnw test -Pintegration"
|
sh "./mvnw test -Pintegration"
|
||||||
|
|
||||||
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*IntegrationTest.xml'])
|
|
||||||
} else {
|
} else {
|
||||||
bat "./mvnw.cmd test -Pintegration"
|
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': {
|
}, 'Deployment': {
|
||||||
stage("Staging") {
|
stage("Staging") {
|
||||||
if (isUnix()) {
|
if (isUnix()) {
|
||||||
sh "pid=\$(lsof -i:8989 -t); kill -TERM \$pid || kill -KILL \$pid"
|
sh "pid=\$(lsof -i:8989 -t); kill -TERM \$pid || kill -KILL \$pid"
|
||||||
} else {
|
} 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']) {
|
withEnv(['JENKINS_NODE_COOKIE=dontkill']) {
|
||||||
|
|
Loading…
Reference in New Issue