-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
34 lines (30 loc) · 1.18 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
node {
stage 'Clone the project'
git 'https://github.com/nick2202/coop-list/'
dir('coop-list') {
stage("Compilation and Analysis") {
parallel 'Compilation': {
bat "./mvnw.cmd clean install -DskipTests"
}
}
stage("Tests and Deployment") {
parallel 'Unit tests': {
stage("Running unit tests") {
try {
bat "./mvnw.cmd test -Punit"
} catch(err) {
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*UnitTest.xml'])
throw err
}
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*UnitTest.xml'])
}
},
stage("Staging") {
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']) {
bat 'start mvnw.cmd spring-boot:run -Dserver.port=8080'
}
}
}
}
}