Created
May 27, 2014 10:52
-
-
Save hSATAC/fc5a67d9f2fcb8b0625c to your computer and use it in GitHub Desktop.
Docker run does not pass exit code back to jenkins. This is a workaround for that.
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
docker build --rm -t $JOB_NAME/$BUILD_NUMBER . | |
docker run $JOB_NAME/$BUILD_NUMBER | perl -pe '/Failed examples:/ && `echo "fail" > docker-tests-failed`' | |
if [ ! -f docker-tests-failed ]; then | |
echo -e "No docker-tests-failed file. Apparently tests passed." | |
else | |
echo -e "docker-tests-failed file found, so build failed." | |
rm docker-tests-failed | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment