diff --git a/hooks/buildfail.sh b/hooks/buildfail.sh index 2bc54f2..7702b40 100755 --- a/hooks/buildfail.sh +++ b/hooks/buildfail.sh @@ -3,6 +3,7 @@ # MATTER_PORTAGE_FAILED_PACKAGE_NAME = CPV of failed package DATE_DIR=$(date +%Y-%m-%d) +SSH_ARGS="-o ConnectTimeout=5" BUILD_LOG=$(echo -n "${MATTER_PORTAGE_BUILD_LOG_DIR}/${MATTER_PORTAGE_FAILED_PACKAGE_NAME}"*.log) if [ -z "${BUILD_LOG}" ]; then @@ -16,7 +17,11 @@ fi REMOTE_DIR="~/tinderbox/${DATE_DIR}/$(uname -m)/${MATTER_PORTAGE_FAILED_PACKAGE_NAME}" echo "Uploading ${BUILD_LOG} to tinderbox.sabayon.org..." -ssh entropy@tinderbox.sabayon.org mkdir -p "${REMOTE_DIR}" +ssh ${SSH_ARGS} entropy@tinderbox.sabayon.org mkdir -p "${REMOTE_DIR}" +if [ "${?}" != "0" ]; then + echo "cannot connect to tinderbox" + exit 1 +fi tmp_path=$(mktemp --suffix=.emerge.info.txt) emerge --info =${MATTER_PORTAGE_FAILED_PACKAGE_NAME} > "${tmp_path}" @@ -25,13 +30,13 @@ if [ "${?}" != "0" ]; then exit ${?} fi chmod 640 "${tmp_path}" -scp "${tmp_path}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ +scp ${SSH_ARGS} "${tmp_path}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ if [ "${?}" != "0" ]; then rm "${tmp_path}" exit 1 fi rm "${tmp_path}" -scp "${BUILD_LOG}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ || exit 1 +scp ${SSH_ARGS} "${BUILD_LOG}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ || exit 1 exit 0