Commit f3c9aff0 authored by Sam Galson's avatar Sam Galson
Browse files

remove ci-test script

parent 97acac62
Pipeline #4044 failed with stages
in 5 minutes and 42 seconds
#!/bin/sh
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m'
export COMPOSE_PROJECT_NAME=inkapi
export COMPOSE_FILE=docker-compose.yml:docker-compose.test.yml
export RAILS_ENV=test
# docker-compose config
# exit
# kill and remove any running containers
cleanup () {
docker-compose down -v --timeout=1
}
# run cleanup now in case the last run didn't exit properly
cleanup
# catch unexpected failures, do cleanup and output an error message
trap 'cleanup ; printf "${RED}Tests Failed For Unexpected Reasons${NC}\n"'\
HUP INT QUIT PIPE TERM
# build composed services and run the tests
docker-compose build
docker-compose up -d postgres redis
docker-compose run ink
TEST_EXIT_CODE=$?
# inspect the output of the test and display respective message
if [[ "$TEST_EXIT_CODE" -ne 0 ]] ; then
printf "${RED}Tests Failed${NC} - Exit Code: $TEST_EXIT_CODE\n"
else
printf "${GREEN}Tests Passed${NC}\n"
fi
# call the cleanup fuction
cleanup
# exit the script with the same code as the test service code
exit $TEST_EXIT_CODE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment