Pipeline: use dedicated workspace to checkout and load pipeline script
...as it seems that `checkout` steps cleans up existing workspace contents.
This is not desirable as checkout takes ages on Windows guests.
--- a/Jenkinsfile Mon Nov 14 22:32:36 2016 +0000
+++ b/Jenkinsfile Tue Nov 15 09:03:17 2016 +0000
@@ -5,8 +5,15 @@
def pipeline;
stage ( "Load Pipeline") {
node {
- checkout scm
- pipeline = load "pipeline.groovy"
+ /*
+ * Do not use default workspace here as checkout
+ * would erase all contents. Use a dedicated
+ * workspace instead
+ */
+ ws ("workspace/${env.JOB_NAME}@loadpipeline") {
+ checkout scm
+ pipeline = load "pipeline.groovy"
+ }
}
}