aboutsummaryrefslogtreecommitdiff
path: root/contrib/cirrus/notice_master_failure.sh
diff options
context:
space:
mode:
authorChris Evich <cevich@redhat.com>2019-03-14 11:57:46 -0400
committerChris Evich <cevich@redhat.com>2019-03-15 21:21:50 -0400
commit0e769210487056f20b7a4c47d195cc939ad5c7db (patch)
tree8278b37610a289f70079a043ca2386152e2baed0 /contrib/cirrus/notice_master_failure.sh
parent3754f58499ad17386d8faa7c2fab1d9cc8231923 (diff)
downloadpodman-0e769210487056f20b7a4c47d195cc939ad5c7db.tar.gz
podman-0e769210487056f20b7a4c47d195cc939ad5c7db.tar.bz2
podman-0e769210487056f20b7a4c47d195cc939ad5c7db.zip
Cirrus: Notify on IRC if post-merge testing fails
Until recently it was very difficult to execute any scripts if part of a task failed. A new feature in Cirrus-CI makes this easy. Use it to post a notice on IRC when any task fails. Also: Add quotes around yaml-string values for consistency and syntax-highlighting correctness. Signed-off-by: Chris Evich <cevich@redhat.com>
Diffstat (limited to 'contrib/cirrus/notice_master_failure.sh')
-rwxr-xr-xcontrib/cirrus/notice_master_failure.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/cirrus/notice_master_failure.sh b/contrib/cirrus/notice_master_failure.sh
new file mode 100755
index 000000000..e18460a54
--- /dev/null
+++ b/contrib/cirrus/notice_master_failure.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+
+source $(dirname $0)/lib.sh
+
+# mIRC "escape" codes are the most standard, for a non-standard client-side interpretation.
+ETX="$(echo -n -e '\x03')"
+RED="${ETX}4"
+NOR="$(echo -n -e '\x0f')"
+
+if [[ "$CIRRUS_BRANCH" =~ "master" ]]
+then
+ BURL="https://cirrus-ci.com/build/$CIRRUS_BUILD_ID"
+ echo "Monitoring execution of $CIRRUS_TASK_NAME and notifying on failure"
+ MSG="${RED}[Action Recommended]: ${NOR}Post-merge testing ${RED}$CIRRUS_BRANCH failed${NOR} in $CIRRUS_TASK_NAME on $(os_release_id)-$(os_release_ver): $BURL. Please investigate, and re-run if appropriate."
+fi
+
+# This script assumed to be executed on failure
+die 1 "Testing Failed"