Created
August 9, 2018 18:22
-
-
Save mtholder/5012eec24687bd79a99b5757b2e32765 to your computer and use it in GitHub Desktop.
cron-executable script (no output except in case of failure) for testing Open Tree services
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 | |
| PAR_DIR=/home/mholder | |
| TEST_OT_DIR="${PAR_DIR}/test-ot-ws" | |
| TEST_LOG_DIR="${PAR_DIR}/testotlogs" | |
| source "${PAR_DIR}/env/test-otc-ws/bin/activate" || exit | |
| source "${TEST_OT_DIR}/dev/activate.sh" || exit | |
| cd "${TEST_OT_DIR}" || exit | |
| date > "${TEST_LOG_DIR}/latest.log" | |
| nf=0 | |
| if ! git pull origin >> "${TEST_LOG_DIR}/latest.log" 2>&1 ; then | |
| nf=1 | |
| fi | |
| if ! test-ot-ws --threads=1 --api-version=v3 >> "${TEST_LOG_DIR}/latest.log" 2>&1 ; then | |
| nf=1 | |
| fi | |
| cat "${TEST_LOG_DIR}/latest.log" >> "${TEST_LOG_DIR}/recent.log" | |
| if ! test $nf -eq 0 ; then | |
| echo Open Tree Services Failing > "${TEST_LOG_DIR}/emailmessage.txt" | |
| cat "${TEST_LOG_DIR}/latest.log" >> "${TEST_LOG_DIR}/emailmessage.txt" | |
| cat "${TEST_LOG_DIR}/emailmessage.txt" | |
| exit 1 | |
| fi |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested with a python 3.7.0 virtualenv and the executable from https://github.com/OpenTreeOfLife/test-ot-ws as the testing script