#!/bin/bash export COMPOSE_PROJECT_NAME=api_client function cleanup() { exit_code=$? set +e docker rmi -f $(docker images -qf "dangling=true") &>/dev/null exit $exit_code } trap cleanup INT TERM EXIT set -e docker-compose build --pull echo "Running test suite..." docker-compose run -d testrunner bash -c 'bundle exec rspec && sleep 10' docker-compose run testrunner bundle exec rspec docker cp $(docker-compose ps -q testrunner):/app/coverage .