Merge "Test salt formula docs pipeline updated Fixed slave labels in pipelines"
diff --git a/test-salt-formula-docs-pipeline.groovy b/test-salt-formula-docs-pipeline.groovy
index cf11e4a..88b29ec 100644
--- a/test-salt-formula-docs-pipeline.groovy
+++ b/test-salt-formula-docs-pipeline.groovy
@@ -25,9 +25,10 @@
     try {
        def workspace = common.getWorkspace()
        def masterName = "cfg01." + CLUSTER_NAME.replace("-","_") + ".lab"
+       //def jenkinsUserIds = common.getJenkinsUserIds()
        def img = docker.image("tcpcloud/salt-models-testing:nightly")
        img.pull()
-       img.inside("-u root:root --hostname ${masterName} --ulimit nofile=4096:8192 --cpus=2") {
+       img.inside("--hostname ${masterName} --ulimit nofile=4096:8192 --cpus=2") {
            stage("Prepare salt env") {
               if(MODEL_GIT_REF != "" && MODEL_GIT_URL != "") {
                   checkouted = gerrit.gerritPatchsetCheckout(MODEL_GIT_URL, MODEL_GIT_REF, "HEAD", CREDENTIALS_ID)
@@ -73,22 +74,25 @@
                 }
            }
            stage("Publish outputs"){
-                sh("mkdir ${workspace}/output")
-                //TODO: verify existance of created output files
-                // /srv/static/sites/reclass_doc will be used for publishHTML step
-                sh("tar -zcf ${workspace}/output/docs-html.tar.gz /srv/static/sites/reclass_doc")
-                sh("cp -R /srv/static/sites/reclass_doc ${workspace}")
-                publishHTML (target: [
-                    allowMissing: false,
-                    alwaysLinkToLastBuild: false,
-                    keepAll: true,
-                    reportDir: 'reclass_doc',
-                    reportFiles: 'index.html',
-                    reportName: "Reclass documentation"
-                ])
-                // /srv/static/extern will be used as tar artifact
-                sh("tar -zcf ${workspace}/output/docs-src.tar.gz /srv/static/extern")
-                archiveArtifacts artifacts: "output/*"
+                try{
+                  sh("mkdir ${workspace}/output")
+                  //TODO: verify existance of created output files
+                  // /srv/static/sites/reclass_doc will be used for publishHTML step
+                  sh("tar -zcf ${workspace}/output/docs-html.tar.gz /srv/static/sites/reclass_doc")
+                  sh("cp -R /srv/static/sites/reclass_doc ${workspace}")
+                  publishHTML (target: [
+                      reportDir: 'reclass_doc',
+                      reportFiles: 'index.html',
+                      reportName: "Reclass-documentation"
+                  ])
+                  // /srv/static/extern will be used as tar artifact
+                  sh("tar -zcf ${workspace}/output/docs-src.tar.gz /srv/static/extern")
+                  archiveArtifacts artifacts: "output/*"
+                }catch(Exception e){
+                    common.errorMsg("Documentation publish stage failed!")
+                }finally{
+                   sh("rm -r ./output")
+                }
            }
        }
     } catch (Throwable e) {
diff --git a/test-salt-formulas-env.groovy b/test-salt-formulas-env.groovy
index b36d4d7..be9c894 100644
--- a/test-salt-formulas-env.groovy
+++ b/test-salt-formulas-env.groovy
@@ -21,7 +21,7 @@
 
 throttle(['test-formula']) {
   timeout(time: 1, unit: 'HOURS') {
-    node("python") {
+    node("python&&docker") {
       try {
         stage("checkout") {
           if (defaultGitRef && defaultGitUrl) {
diff --git a/test-salt-model-node.groovy b/test-salt-model-node.groovy
index 5ff8ff3..3893066 100644
--- a/test-salt-model-node.groovy
+++ b/test-salt-model-node.groovy
@@ -30,7 +30,7 @@
 
 throttle(['test-model']) {
   timeout(time: 1, unit: 'HOURS') {
-    node("python") {
+    node("python&&docker") {
       try{
         stage("checkout") {
           if(defaultGitRef != "" && defaultGitUrl != "") {