Created
June 25, 2018 12:51
-
-
Save asantos2000/9043e7466d873bf4bd46a57651ccc1c3 to your computer and use it in GitHub Desktop.
Run dredd image as a command line
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
#!/bin/bash | |
echo '***' | |
echo 'Root dir is /api' | |
export MYIP=`ifconfig | sed -En 's/127.0.0.1//;s/.*inet (addr:)?(([0-9]*\.){3}[0-9]*).*/\2/p'` | |
echo 'Configure URL of tested API endpoint: http://api-srv::<enpoint-port>. Set api-srv to point to your server.' | |
echo 'This script will set api-srv to docker host machine - ' $MYIP | |
echo 'Optional. Save this script in your PATH and give it an alias:' | |
echo "alias dredd='bash ./scripts/dredd.sh'" | |
echo '***' | |
docker run -it --add-host "api-srv:$MYIP" -v $PWD:/api -w /api apiaryio/dredd dredd $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment