Created
May 30, 2019 09:17
-
-
Save chmouel/e1dea5ad963dfce371894241c88c309d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
SED=sed;type -p gsed >/dev/null 2>/dev/null && SED=gsed #osx blah | |
JOB_NAME=${1-pull-tekton-pipeline-integration-tests} | |
JOB_URL=$(hub ci-status -v| sed -n "/${JOB_NAME}/ { s/.*https/https/;p;}") | |
rm -f /tmp/.prjtlogs${JOB_NAME}.* # Cleanups | |
TMP=$(mktemp /tmp/.prjtlogs${JOB_NAME}.XXXXXX) | |
[[ -z ${JOB_URL} ]] && { | |
echo "Sorry buddy, I could not find any url for ${JOB_NAME} in github ci-status" | |
exit 1 | |
} | |
LOG_URL=$(echo ${JOB_URL}|sed 's,https://tekton-releases.appspot.com/build,https://storage.googleapis.com,;s,/$,,') | |
curl -sL -o${TMP} $LOG_URL/build-log.txt | |
grep -q '==== INTEGRATION TESTS FAILED ====' ${TMP} && failure=1 | |
if [[ -n ${failure} ]];then | |
echo "😿" | |
${SED} -nr '/ --- FAIL/,/(===|---) / { p ;}' ${TMP} | |
else | |
echo "😻 Success!" | |
fi | |
echo "🕵️ => ${TMP}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment