Skip to content

Instantly share code, notes, and snippets.

@stewsnooze
Created December 9, 2011 12:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stewsnooze/1451329 to your computer and use it in GitHub Desktop.
Save stewsnooze/1451329 to your computer and use it in GitHub Desktop.
Detecting errors in drush in Jenkins
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