Skip to content

Instantly share code, notes, and snippets.

@musghost
Last active August 26, 2015 00:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save musghost/b8ef29dad7ad3985895b to your computer and use it in GitHub Desktop.
Save musghost/b8ef29dad7ad3985895b to your computer and use it in GitHub Desktop.
docker run --name myjenkins -p 8080:8080 -v $PWD:/app -v /usr/local/bin/docker:/bin/docker -v /var/run/docker.sock:/var/run/docker.sock my-jenkins
Mocha reporter
/tmp/jenkins-buildenv/${JOB_NAME}/workspace
https://github.com/musghost/mocha-test
# Build the image to be used for this job.
IMAGE=$(docker build . | tail -1 | awk '{ print $NF }')
# Build the directory to be mounted into Docker.
MNT="$WORKSPACE/.."
# Execute the build inside Docker.
CONTAINER=$(docker run -d -v $PWD:/app $IMAGE)
# Attach to the container so that we can see the output.
docker attach $CONTAINER
# Get its exit code as soon as the container stops.
RC=$(docker wait $CONTAINER)
# Delete the container we've just used.
docker rm $CONTAINER
# Exit with the same value as that with which the process exited.
exit $RC
results/*.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment