Add option to clean workspace, default to yes

This commit is contained in:
Jim Nicholson 2024-02-08 19:37:02 -08:00
parent 29648d6ad4
commit 9bea81a288

View File

@ -3,10 +3,14 @@
void call(Map config = [:], Closure body = { }) {
Map defaults = [
stepName: 'Checkout',
useJobSCM: true
useJobSCM: true,
cleanWorkspace: true
]
runConfig = defaults + config
stage(runConfig.stepName) {
if (runConfig.cleanWorkspace) {
cleanWs disableDeferredWipeout: true
}
printBanner(runConfig.stepName)
if (runConfig.useJobSCM) {
checkout scm