diff --git a/services/matter_examples/buildfail-tinderbox.sh b/services/matter_examples/buildfail-tinderbox.sh new file mode 100755 index 000000000..e574919d8 --- /dev/null +++ b/services/matter_examples/buildfail-tinderbox.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# MATTTER_PORTAGE_REPOSITORY = portage repository +# MATTER_PORTAGE_FAILED_PACKAGE_NAME = CPV of failed package + +DATE_DIR=$(date +%Y-%m-%d-%H:%M) + +BUILD_LOG=$(echo -n "${MATTER_PORTAGE_BUILD_LOG_DIR}/${MATTER_PORTAGE_FAILED_PACKAGE_NAME}"*.log) +if [ -z "${BUILD_LOG}" ]; then + echo "cannot find build log, wtf??" + exit 1 +fi +if [ ! -f "${BUILD_LOG}" ]; then + echo "cannot find build log file" + exit 1 +fi +REMOTE_DIR="~/tinderbox/${DATE_DIR}/${MATTER_PORTAGE_FAILED_PACKAGE_NAME}" + +echo "Uploading ${BUILD_LOG} to tinderbox.sabayon.org..." +ssh entropy@tinderbox.sabayon.org mkdir -p "${REMOTE_DIR}" + +tmp_path=$(mktemp --suffix=.emerge.info.txt) +emerge --info =${MATTER_PORTAGE_FAILED_PACKAGE_NAME} > "${tmp_path}" +if [ "${?}" != "0" ]; then + rm "${tmp_path}" + exit ${?} +fi +chmod 640 "${tmp_path}" +scp "${tmp_path}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ || exit 1 +scp "${BUILD_LOG}" entropy@tinderbox.sabayon.org:"${REMOTE_DIR}"/ || exit 1 + +exit 0 + diff --git a/services/matter_examples/fail.particle b/services/matter_examples/fail.particle index 62b904f58..ef44f7ff3 100644 --- a/services/matter_examples/fail.particle +++ b/services/matter_examples/fail.particle @@ -76,7 +76,7 @@ removed-useflags: yes # comes from # MATTER_PORTAGE_BUILD_LOG_DIR = directory containing all the build logs of # the failed package -buildfail: /home/fabio/repos/entropy/services/matter_examples/buildfail.sh +buildfail: /home/fabio/repos/entropy/services/matter_examples/buildfail-tinderbox.sh # For more info regarding exported environment variables, please see: # matter --help