From cc0bc4063bfac6d6bf58a6550c91e200249536fc Mon Sep 17 00:00:00 2001 From: Stephen Smoogen Date: Mon, 1 Jul 2019 13:24:08 +0000 Subject: [PATCH] [ftbfs] try to get this script to run and be verbose about it --- roles/releng/files/ftbfs.cron | 2 +- roles/releng/files/ftbfs.sh | 28 ++++++++++++++++++++++++++++ roles/releng/tasks/main.yml | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 roles/releng/files/ftbfs.sh diff --git a/roles/releng/files/ftbfs.cron b/roles/releng/files/ftbfs.cron index 4c3ad04d45..6af48ffe6d 100644 --- a/roles/releng/files/ftbfs.cron +++ b/roles/releng/files/ftbfs.cron @@ -1,2 +1,2 @@ #FTBFS Weekly Reminder -* * 0 0 * ftbfs TMPDIR=`mktemp -d /tmp/ftbfs_reminder.XXXXXX` && pushd $TMPDIR && git clone https://pagure.io/releng.git && pushd releng/scripts && ./ftbfs_weekly_reminder.py && popd && popd && popd &&rm -rf $TMPDIR +* * 0 0 * ftbfs /usr/local/bin/ftbfs.sh diff --git a/roles/releng/files/ftbfs.sh b/roles/releng/files/ftbfs.sh new file mode 100644 index 0000000000..20ca50fb5f --- /dev/null +++ b/roles/releng/files/ftbfs.sh @@ -0,0 +1,28 @@ +#!/bin/bash +TMPDIR=`mktemp -d /tmp/ftbfs_reminder.XXXXXX` +GITREPO=https://pagure.io/releng.git +SCRIPT=ftbfs_weekly_reminder.py +if [ $? -eq 0 ]; then + cd ${TMPDIR} + git clone ${GITREPO} + if [ $? -eq 0 ]; then + cd releng/scripts + ./${SCRIPT} + if [ $? -ne 0 ]; then + echo "${SCRIPT} had an error condition" + echo "Look in ${TMPDIR} for more info" + # Do not clean up trash + exit 1 + fi + else + echo "Unable to clone ${GITREPO}" + echo "Look in ${TMPDIR} for more info" + # Do not clean up trash + exit 1 + fi + cd /tmp/ + rm -rf $TMPDIR +else + echo "Unable to create ${TMPDIR}" + exit 1 +fi diff --git a/roles/releng/tasks/main.yml b/roles/releng/tasks/main.yml index f270537d6c..a6ce675170 100644 --- a/roles/releng/tasks/main.yml +++ b/roles/releng/tasks/main.yml @@ -49,6 +49,12 @@ tags: - ftbfs +- name: copy over ftbfs master script. + copy: src="ftbfs.sh" dest=/usr/local/bin/sh mode=755 + when: inventory_hostname.startswith('compose-x86-01') + tags: + - ftbfs + - name: add ftbfs weekly cron job copy: src="ftbfs.cron" dest=/etc/cron.weekly/ mode=755 when: inventory_hostname.startswith('compose-x86-01')