-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
25 lines (21 loc) · 1.02 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
node('docker') {
stage 'Checkout'
checkout scm
stage 'Build & UnitTest'
sh "docker build -t accountownerapp:B${BUILD_NUMBER} -f Dockerfile ."
sh "docker build -t accountownerapp:test-B${BUILD_NUMBER} -f Dockerfile.Integration ."
stage 'Pusblish UT Reports'
containerID = sh (
script: "docker run -d accountownerapp:B${BUILD_NUMBER}",
returnStdout: true
).trim()
echo "Container ID is ==> ${containerID}"
sh "docker cp ${containerID}:/TestResults/test_results.xml test_results.xml"
sh "docker stop ${containerID}"
sh "docker rm ${containerID}"
step([$class: 'MSTestPublisher', failOnError: false, testResultsFile: 'test_results.xml'])
stage 'Integration Test'
//sh 'docker-compose -f docker-compose.integration.yml up'
sh "docker-compose -f docker-compose.integration.yml up --force-recreate --abort-on-container-exit"
sh "docker-compose -f docker-compose.integration.yml down -v"
}