Created
December 9, 2011 12:21
-
-
Save stewsnooze/1451329 to your computer and use it in GitHub Desktop.
Detecting errors in drush in Jenkins
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
YOURDRUSHCOMMAND 2>&1 |tee /tmp/test$BUILD_ID | |
if [ `grep -e "Fatal error" /tmp/test$BUILD_ID | wc -l` != 0 ]; then | |
ERROR_LEVEL=1 | |
fi | |
..... | |
if [ `grep -e "^.* passes," /tmp/test$BUILD_ID | grep -v "0 fails" | wc -l` == 0 ]; then | |
echo "exited $ERROR_LEVEL" > /tmp/exit_code | |
exit $ERROR_LEVEL | |
else | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment