Last active
December 24, 2015 10:54
-
-
Save forbesmyester/4ef096dcda52351db8c3 to your computer and use it in GitHub Desktop.
Quick Unit Tests in Docker
This file contains 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
#!/bin/bash | |
# Run tests (or anything else) in Docker by doing a tagged build and then run, which should make things much faster. | |
# | |
# @author forbesmyester | |
# @license MIT | |
DOCKER_TAG=$(echo $PWD | tr '[:upper:]' '[:lower:]' | sed 's/^\///' | sed 's/\//-/g') | |
echo "" | |
echo "== USING DOCKER TAG: test-$DOCKER_TAG ==========================" | |
echo "" | |
DOCKERFILE="./Dockerfile.docker-test" | |
if [ "$#" -gt 0 ] ; then | |
echo "HERE" | |
DOCKERFILE=$1 | |
fi | |
docker build -t "test-${DOCKER_TAG}" -f $DOCKERFILE . && docker run "test-${DOCKER_TAG}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment