Is there a way to run a pre-checkout step in declarative Jenkins pipelines?
07:05 27 Jul 2017

Jenkins declarative pipelines offer a post directive to execute code after the stages have finished. Is there a similar thing to run code before the stages are running, and most importantly, before the SCM checkout?

For example, something along the lines of:

pre {
    always {
        rm -rf ./*
    }
}

This would then clean the workspace of my build before the source code is checked out.

jenkins build jenkins-pipeline