summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xround-robin-bisect.sh29
1 files changed, 22 insertions, 7 deletions
diff --git a/round-robin-bisect.sh b/round-robin-bisect.sh
index 3008b649..258b4666 100755
--- a/round-robin-bisect.sh
+++ b/round-robin-bisect.sh
@@ -648,9 +648,6 @@ case "${rr[ci_project]}" in
;;
esac
-# Remove any fail-safe email body
-rm -f $artifacts/jenkins/mail-body.txt
-
if $notify_devs; then
occurences="$(cat $current_project/$interesting_commits/$current_project | grep "^$first_bad" | sed -e "s/^$first_bad *//" | tr ' ' '\n' | sed "s#^# - #")"
if [ "$(echo "$occurences" | wc -l)" -le 1 ]; then
@@ -675,6 +672,8 @@ if $notify_devs; then
*) jira_card="GNU-692" ;;
esac
+ rm -f $artifacts/jenkins/mail-body.draft
+
if [ x"${TCWG_JIRA_TOKEN+set}" = x"set" ] && [ x"$jira_card" != x"" ]; then
cat > $artifacts/jenkins/jira-body.txt <<EOF
[$jira_card]
@@ -700,12 +699,14 @@ EOF
echo y | jipdate.py -f $artifacts/jenkins/jira-body.txt &
res=0 && wait $! || res=$?
if [ $res != 0 ]; then
- echo "WARNING: Could not post this report to $jira_card" \
- >> $artifacts/jenkins/mail-body.txt
+ cat >> $artifacts/jenkins/mail-body.draft <<EOF
+WARNING: Could not post this report to $jira_card
+
+EOF
fi
fi
- cat >> $artifacts/jenkins/mail-body.txt <<EOF
+ cat >> $artifacts/jenkins/mail-body.draft <<EOF
Identified regression caused by *$current_project:$first_bad*:
$(git -C $current_project log --pretty=short -n 1 $first_bad)
@@ -763,6 +764,10 @@ $(git -C $current_project show --stat --patch $first_bad | head -n 1000)
</cut>
EOF
+ cat > $artifacts/jenkins/mail-subject.draft <<EOF
+[TCWG CI] Regression caused by $current_project:$first_bad
+EOF
+
# Set mail recipients last to preserve catch-error value from .yaml file.
# Email developers.
CI_MAIL_RECIPIENTS=("bcc:tcwg-validation@linaro.org")
@@ -804,12 +809,22 @@ EOF
(
IFS=","
- cat > $artifacts/jenkins/mail-recipients.txt <<EOF
+ cat > $artifacts/jenkins/mail-recipients.draft <<EOF
${CI_MAIL_RECIPIENTS[*]}
EOF
)
+
+ mv $artifacts/jenkins/mail-recipients.draft \
+ $artifacts/jenkins/mail-recipients.txt
+ mv $artifacts/jenkins/mail-subject.draft \
+ $artifacts/jenkins/mail-subject.txt
+ mv $artifacts/jenkins/mail-body.draft \
+ $artifacts/jenkins/mail-body.txt
else
+ # Remove any fail-safe email stubs
echo > $artifacts/jenkins/mail-recipients.txt
+ echo > $artifacts/jenkins/mail-subject.txt
+ echo > $artifacts/jenkins/mail-body.txt
fi
trap "" EXIT