[gnome-build-meta/sthursfield/james/openqa-master] openqa: Always teardown worker



commit ba537a7ad8fef1140465466bf34516f002f831cf
Author: Sam Thursfield <sam afuera me uk>
Date:   Tue Aug 10 13:46:57 2021 +0200

    openqa: Always teardown worker
    
    Also, print server output to stderr if we didn't manage to create the
    job at all.

 .gitlab-ci.yml | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2f9b3e4a..58ac8667 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -442,8 +442,18 @@ test-iso-installer-x86_64:
     openqa/utils/start_job.sh ${worker_class} ${CI_COMMIT_REF_NAME} > /tmp/job_id
     echo "Test job has been started, visit $OPENQA_HOST/tests/$(cat /tmp/job_id) to see the progress"
   - openqa/utils/wait_for_job.sh $(cat /tmp/job_id) > /tmp/exit_code
-  - openqa/utils/teardown_worker.sh $(cat /tmp/machine_id)
   - exit $(cat /tmp/exit_code)
+  after_script:
+  - |
+    if [ -e /tmp/machine_id ]; then
+        echo "Cleaning up worker"
+        openqa/utils/teardown_worker.sh $(cat /tmp/machine_id)
+        rm /tmp/machine_id
+    fi
+  - if [ ! -e /tmp/exit_code ]; then
+        echo "Job creation failed, log below."
+        cat openqa.log
+  - fi
   artifacts:
     when: always
     paths:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]