Nightly build: show fail message in summary
When the build fails, show the failure message in the task summary
directly.
Change-Id: Idff59fccf7434b760245ccb05e9e60a46004edaa
diff --git a/roles/cws-publish/tasks/main.yaml b/roles/cws-publish/tasks/main.yaml
index a6ef36f..c31dd85 100644
--- a/roles/cws-publish/tasks/main.yaml
+++ b/roles/cws-publish/tasks/main.yaml
@@ -41,5 +41,9 @@
executable: /bin/bash
no_log: True
register: uploadcmd
- failed_when:
- - "not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stdout) or ('PKG_INVALID_VERSION_NUMBER') in uploadcmd.stdout)"
+ failed_when: false
+
+- name: Check whether the upload was successful
+ when: "not (dry_run|bool) and not (uploadcmd.rc == 0 or ('ITEM_NOT_UPDATABLE' in uploadcmd.stdout) or ('PKG_INVALID_VERSION_NUMBER') in uploadcmd.stdout)"
+ fail:
+ msg: "{{ uploadcmd.stdout }}"