piwigodotnet/Jenkinsfile

45 lines
939 B
Plaintext
Raw Normal View History

2022-10-25 22:17:59 +02:00
pipeline {
agent {
2022-10-25 22:31:58 +02:00
docker { image 'mcr.microsoft.com/dotnet/sdk:6.0'}
2022-10-25 22:17:59 +02:00
}
2022-10-25 22:41:49 +02:00
environment {
2022-10-25 22:59:56 +02:00
PWDNVERSION = "0.1.0"
// home is required to make dotnet work as if undived / is used which is not accessible
2022-10-25 22:44:52 +02:00
HOME = "${env.WORKSPACE}"
2022-10-25 22:41:49 +02:00
}
2022-10-25 22:17:59 +02:00
stages {
2022-10-25 23:08:41 +02:00
stage('cleaning workspace') {
steps {
sh "rm -rf ${env.WORKSPACE}/publish"
}
}
2022-10-25 22:17:59 +02:00
stage('nuget restore') {
steps {
2022-10-25 22:43:46 +02:00
sh "dotnet restore ${env.WORKSPACE}/src/PiwigoDotnet.sln"
2022-10-25 22:17:59 +02:00
}
}
2022-10-25 22:59:56 +02:00
stage('test') {
steps {
sh "dotnet test ${env.WORKSPACE}/src/PiwigoDotnet.sln --no-restore"
2022-10-25 22:59:56 +02:00
}
}
stage('packing') {
steps {
sh "dotnet pack ${env.WORKSPACE}/src/PiwigoDotnet.sln --no-restore -o ${env.WORKSPACE}/publish -p:Version=${env.PWDNVERSION}.${env.BUILD_NUMBER}"
2022-10-25 22:59:56 +02:00
}
}
2022-10-25 22:17:59 +02:00
2022-10-25 22:59:56 +02:00
}
post {
always {
archiveArtifacts artifacts: "publish/*.nupkg", onlyIfSuccessful: true
2022-10-25 22:59:56 +02:00
}
2022-10-25 22:17:59 +02:00
}
}