piwigodotnet/Jenkinsfile
Philipp Häfelfinger 32be0e336a
All checks were successful
piwigodotnet/pipeline/head This commit looks good
ensure publish does not exist
2022-10-25 23:08:41 +02:00

45 lines
939 B
Groovy

pipeline {
agent {
docker { image 'mcr.microsoft.com/dotnet/sdk:6.0'}
}
environment {
PWDNVERSION = "0.1.0"
// home is required to make dotnet work as if undived / is used which is not accessible
HOME = "${env.WORKSPACE}"
}
stages {
stage('cleaning workspace') {
steps {
sh "rm -rf ${env.WORKSPACE}/publish"
}
}
stage('nuget restore') {
steps {
sh "dotnet restore ${env.WORKSPACE}/src/PiwigoDotnet.sln"
}
}
stage('test') {
steps {
sh "dotnet test ${env.WORKSPACE}/src/PiwigoDotnet.sln --no-restore"
}
}
stage('packing') {
steps {
sh "dotnet pack ${env.WORKSPACE}/src/PiwigoDotnet.sln --no-restore -o ${env.WORKSPACE}/publish -p:Version=${env.PWDNVERSION}.${env.BUILD_NUMBER}"
}
}
}
post {
always {
archiveArtifacts artifacts: "publish/*.nupkg", onlyIfSuccessful: true
}
}
}