Created
November 12, 2014 19:08
-
-
Save KyleAMathews/8207b9021ede93f70cb9 to your computer and use it in GitHub Desktop.
RR's CI
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 | |
# Start DBs | |
echo "Create test instances of Rethinkdb and Influxdb:" | |
number=$RANDOM | |
rethinkdb=`docker run -d --name rethinkdb-$number dockerfile/rethinkdb` | |
influxdb=`docker run -d --name influxdb-$number tutum/influxdb` | |
echo "Success!" | |
echo "" | |
sleep 5 | |
apiInstance=`docker run -d --name api-$number --link rethinkdb-$number:db --link influxdb-$number:influx api` | |
webInstance=`docker run -d --link api-$number:api webapp` | |
ipAddress=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' $webInstance` | |
echo "Lint Coffeescript:" | |
docker run --rm webapp node_modules/.bin/coffeelint -f .coffeelint.json . || { echo 'linting failed' ; exit 1; } | |
docker run --rm webapp node_modules/.bin/coffee lint_cjsx.coffee | |
echo "" | |
echo "Audit NPM packages for security problems:" | |
docker run --rm webapp node_modules/.bin/nsp audit-package || { echo 'security audit failed' ; exit 1; } | |
echo "" | |
echo "Curl instance of Webapp" | |
curl --retry 10 --retry-delay 5 --silent $ipAddress:8081/service-status || { echo 'curling instance failed' ; exit 1; } | |
echo "" | |
# Remove test containers we created. | |
docker rm -f $rethinkdb $influxdb $apiInstance $webInstance >> /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment