clean the workspace in the publisher 91/60591/3
authordongwenjuan <dong.wenjuan@zte.com.cn>
Mon, 6 Aug 2018 08:10:03 +0000 (16:10 +0800)
committerdongwenjuan <dong.wenjuan@zte.com.cn>
Mon, 6 Aug 2018 08:30:37 +0000 (16:30 +0800)
As doctor run tox under root user, we need to clean
the workspace in the publisher, otherwise the tests
which come next will be fail when they operate in
the workspace with jenkins user.

Change-Id: I14fbabc7516153c6d93e53baf106067ff4194af6
Signed-off-by: dongwenjuan <dong.wenjuan@zte.com.cn>
jjb/doctor/doctor.yaml
jjb/global/releng-macros.yaml

index e919111..6a8e07b 100644 (file)
     name: 'doctor-verify-installer-inspector-builders-macro'
     builders:
       # yamllint disable rule:indentation
-      - 'clean-workspace-log'
       - shell:
           !include-raw:
               - ./doctor-env-presetup.sh
           # As Jenkins user, it has no permission to send ICMP package
           sudo -E tox -e py34
 
+
 # -------------------------------
 # publisher macros
 # -------------------------------
       - archive:
           artifacts: 'doctor_tests/*.log'
       - email-jenkins-admins-on-failure
+      - 'post-clean-workspace'
 
 
 #####################################
index b282cff..d2da7f6 100644 (file)
                 - shell:
                     !include-raw: installer-report.sh
           mark-unstable-if-failed: true
+
+- publisher:
+    name: 'post-clean-workspace'
+    publishers:
+      - postbuildscript:
+          builders:
+            - role: SLAVE
+              build-on:
+                - ABORTED
+                - FAILURE
+                - NOT_BUILT
+                - UNSTABLE
+                - SUCCESS
+              build-steps:
+                - shell: |
+                    #!/bin/bash
+                    set -o errexit
+                    set -o nounset
+                    set -o pipefail
+                    sudo /bin/rm -rf "$WORKSPACE"