-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
29 lines (28 loc) · 775 Bytes
/
Jenkinsfile
File metadata and controls
29 lines (28 loc) · 775 Bytes
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
#!/usr/bin/env groovy
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'dotnet build StringCalc.sln'
}
}
stage('Test'){
steps {
sh 'dotnet test StringCalc.core.test/StringCalc.core.test.csproj --logger:trx --results-directory:"./"'
step([$class: 'MSTestPublisher', testResultsFile:"**/*.trx", failOnError: true, keepLongStdio: true])
}
}
stage('Package') {
steps {
sh 'docker build -t stringcalc:$BUILD_NUMBER .'
}
}
stage('Deploy') {
steps {
sh 'docker stop stringcalc || true && docker rm stringcalc || true'
sh 'docker run -d -p 5000:80 --name stringcalc stringcalc:$BUILD_NUMBER'
}
}
}
}