Added cleanup step to Jenkins pipeline.

Removes all items in publish folders after pipeline complete.

Fixed publish configuration in pipeline.
This commit is contained in:
Harrison Deng 2022-04-25 00:48:46 -05:00
parent 093670385e
commit 190ea16b02

13
Jenkinsfile vendored
View File

@ -17,7 +17,7 @@ pipeline {
stage("Publish") {
steps {
dotnetPublish configuration: 'Release', noRestore: true, project: 'Props.Shop/Props.Shop.sln', selfContained: false, unstableIfWarnings: true
archiveArtifacts artifacts: 'Props.Shop/**/bin/Release/**/publish/Props.Shop.*', excludes: 'Props.Shop/*.Tests/**/*', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
archiveArtifacts artifacts: 'Props.Shop/**/bin/Release/**/publish/Props*', excludes: 'Props.Shop/*.Tests/**/*', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
sh "python3 scripts/load_shop_modules.py"
}
}
@ -38,11 +38,20 @@ pipeline {
}
stage("Publish") {
steps {
dotnetPublish noRestore: true, project: 'Props', sdk: 'Default .NET SDK'
dotnetPublish configuration: 'Release', noRestore: true, project: 'Props', sdk: 'Default .NET SDK'
archiveArtifacts artifacts: 'Props/bin/Release/**/publish/Props*', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
}
}
}
}
stage("cleanup") {
steps {
dotnetClean project: 'Props/', sdk: 'Default .NET SDK'
dotnetClean project: 'Props.Tests/', sdk: 'Default .NET SDK'
dotnetClean project: 'Props.Shop/Props.Shop.sln', sdk: 'Default .NET SDK'
dotnetClean project: 'Props.Shop/Props.Shop.Tests.sln', sdk: 'Default .NET SDK'
cleanWs(patterns: [[pattern: '**/bin/**/publish', type: 'INCLUDE']])
}
}
}
}