2020-02-28 22:30:42 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
2021-03-18 16:38:34 +01:00
|
|
|
stage('Test') {
|
2020-02-28 22:30:42 +01:00
|
|
|
steps {
|
2021-03-18 16:38:34 +01:00
|
|
|
sh 'dotnet test --collect:"XPlat Code Coverage"'
|
2020-02-28 22:30:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Pack') {
|
|
|
|
steps {
|
|
|
|
sh 'find . -type f -name \\\'*.nupkg\\\' -delete'
|
2021-03-18 16:38:34 +01:00
|
|
|
sh 'dotnet pack --version-suffix ${BUILD_NUMBER}'
|
2020-02-28 22:30:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish') {
|
2021-01-01 11:10:35 +01:00
|
|
|
when {
|
2021-10-24 00:44:30 +02:00
|
|
|
branch 'main'
|
2021-01-01 11:10:35 +01:00
|
|
|
}
|
2020-02-28 22:30:42 +01:00
|
|
|
steps {
|
2021-01-01 11:10:35 +01:00
|
|
|
sh 'dotnet nuget push -s http://localhost:5000/v3/index.json **/*.nupkg -k $BAGET -n true'
|
2020-02-28 22:30:42 +01:00
|
|
|
}
|
|
|
|
}
|
2021-03-20 21:28:36 +01:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
nunit testResultsPattern: '**/TestResults.xml'
|
|
|
|
cobertura coberturaReportFile: '**/coverage.cobertura.xml'
|
|
|
|
}
|
2020-02-28 22:30:42 +01:00
|
|
|
}
|
|
|
|
environment {
|
2020-02-28 22:31:24 +01:00
|
|
|
BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676')
|
2020-02-28 22:30:42 +01:00
|
|
|
}
|
2021-01-01 11:10:35 +01:00
|
|
|
}
|