Merge "Copy content of the workspace directory"
diff --git a/gating-pipeline.groovy b/gating-pipeline.groovy
index 4efb430..8cc5031 100644
--- a/gating-pipeline.groovy
+++ b/gating-pipeline.groovy
@@ -24,7 +24,7 @@
           if (_jobExists(testJob)) {
             common.infoMsg("Test job ${testJob} found, running")
             build job: testJob, parameters: [
-              [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}.git"],
+              [$class: 'StringParameterValue', name: 'DEFAULT_GIT_URL', value: "${GERRIT_SCHEME}://${GERRIT_NAME}@${GERRIT_HOST}:${GERRIT_PORT}/${GERRIT_PROJECT}"],
               [$class: 'StringParameterValue', name: 'DEFAULT_GIT_REF', value: GERRIT_REFSPEC]
             ]
           } else {
diff --git a/generate-cookiecutter-products.groovy b/generate-cookiecutter-products.groovy
index 304f971..d836afb 100644
--- a/generate-cookiecutter-products.groovy
+++ b/generate-cookiecutter-products.groovy
@@ -50,6 +50,7 @@
                 templateDir = "${templateEnv}/cluster_product/infra"
                 templateOutputDir = "${env.WORKSPACE}/template/output/infra"
                 sh "mkdir -p ${templateOutputDir}"
+                sh "mkdir -p ${outputDestination}"
                 python.setupCookiecutterVirtualenv(cutterEnv)
                 python.buildCookiecutterTemplate(templateDir, templateContext, templateOutputDir, cutterEnv)
                 sh "mv -v ${templateOutputDir}/${clusterName}/* ${outputDestination}"
diff --git a/test-groovy-pipeline.groovy b/test-groovy-pipeline.groovy
index 71e9fc0..edd549a 100644
--- a/test-groovy-pipeline.groovy
+++ b/test-groovy-pipeline.groovy
@@ -38,7 +38,7 @@
               checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, defaultGitRef, "HEAD", CREDENTIALS_ID)
           }
           if(!checkouted){
-            common.errorMsg("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
+            throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
           }
         }
         stage ('Run Codenarc tests'){
diff --git a/test-salt-formulas-pipeline.groovy b/test-salt-formulas-pipeline.groovy
index 91f977b..e53e652 100644
--- a/test-salt-formulas-pipeline.groovy
+++ b/test-salt-formulas-pipeline.groovy
@@ -37,7 +37,7 @@
           checkouted = gerrit.gerritPatchsetCheckout(defaultGitUrl, defaultGitRef, "HEAD", CREDENTIALS_ID)
       }
       if(!checkouted){
-        common.errorMsg("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
+        throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
       }
     }
     stage("test") {
diff --git a/test-salt-models-pipeline.groovy b/test-salt-models-pipeline.groovy
index 05695b2..d43c217 100644
--- a/test-salt-models-pipeline.groovy
+++ b/test-salt-models-pipeline.groovy
@@ -49,7 +49,7 @@
           ssh.agentSh("git submodule init; git submodule sync; git submodule update --recursive")
         }
       }else{
-        common.errorMsg("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
+        throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
       }
     }
     stage("test") {
diff --git a/test-system-reclass-pipeline.groovy b/test-system-reclass-pipeline.groovy
index a63a7df..65fce27 100644
--- a/test-system-reclass-pipeline.groovy
+++ b/test-system-reclass-pipeline.groovy
@@ -57,7 +57,7 @@
         }
       parallel branches
     }else{
-       common.errorMsg("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
+       throw new Exception("Cannot checkout gerrit patchset, GERRIT_REFSPEC and DEFAULT_GIT_REF is null")
     }
   }
 } catch (Throwable e) {