-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummarize-log.sh
More file actions
32 lines (28 loc) · 1.17 KB
/
summarize-log.sh
File metadata and controls
32 lines (28 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# defined variables
URL="https://0x0.st"
FILE=travisOutput.txt
SUMMARY=summary.txt
# remove the summary if it already exists
rm -f summary.txt
# set up info for summary
echo "Summary of Travis Log for Test/Build Failures" >> ${SUMMARY}
echo "----------------------------------------------" >> ${SUMMARY}
echo "" >> ${SUMMARY}
echo "Branch: ${TRAVIS_BRANCH}" >> ${SUMMARY}
echo "Commit ID: ${TRAVIS_COMMIT}" >> ${SUMMARY}
echo "Commit Message: ${TRAVIS_COMMIT_MESSAGE}" >> ${SUMMARY}
echo "Caused By: ${AUTHOR_NAME}" >> ${SUMMARY}
echo "" >> ${SUMMARY}
echo "" >> ${SUMMARY}
echo "--- FAILURE ---" >> ${SUMMARY}
echo "**************************" >> ${SUMMARY}
echo "" >> ${SUMMARY}
awk '/> Task :k9mail:compileDebugJavaWithJavac FAILED|> Task :k9mail:testDebugUnitTest/{flag=1} /FAILURE: Build failed with an exception./{flag=0} flag' ${FILE} >> ${SUMMARY}
echo "**************************" >> ${SUMMARY}
# print to an outside source to view summary
echo ""
echo "There was a failure, view the URL below for a summary of what happened:"
echo "-----------------------------------------------------------------------"
RESPONSE=$(curl -# -F "file=@${SUMMARY}" "${URL}")
echo "${RESPONSE}"