We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6a2c88 commit 30b0ef4Copy full SHA for 30b0ef4
cron.sh
@@ -1,6 +1,13 @@
1
-#!/bin/sh
+#!/bin/bash
2
3
# Script to run in cron for production, once puppet has set everything up
4
-# Only produces output if the `Result:` line does not contain `PASS`
+# Only produces output if the last `Result:` line does not contain `PASS`
5
6
-~/bin/metacpan-monitoring-carton exec ~/carton/metacpan-monitoring/bin/swat | tail -1 | grep -v 'Result: PASS'
+export SWAT_FILE="/tmp/last_swat_run"
7
+
8
+# Run and save output to tmp
9
+~/bin/metacpan-monitoring-carton exec ~/carton/metacpan-monitoring/bin/swat > $SWAT_FILE
10
11
+# Look at the last line, if it does NOT match 'Result: PASS' then cat
12
+# the whole file for us to debug
13
+tail -1 $SWAT_FILE | grep -v 'Result: PASS' && cat $SWAT_FILE
0 commit comments