Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hSATAC
Created May 27, 2014 10:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hSATAC/fc5a67d9f2fcb8b0625c to your computer and use it in GitHub Desktop.
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.
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