2018-05-29 20:14:19 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
docker_compose="docker-compose --file docker-compose.yml"
|
|
|
|
|
|
|
|
|
|
function cleanup() {
|
|
|
|
|
$docker_compose down
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-30 08:21:21 -05:00
|
|
|
function die() {
|
|
|
|
|
echo $@
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-05-29 20:14:19 -05:00
|
|
|
trap cleanup EXIT
|
|
|
|
|
|
|
|
|
|
export RAILS_ENV=test
|
|
|
|
|
|
|
|
|
|
# Put a config/site.yml file in place since it's needed for operation
|
|
|
|
|
cp config/site.yml.tmpl config/site.yml
|
|
|
|
|
|
|
|
|
|
$docker_compose build
|
|
|
|
|
$docker_compose up -d
|
2018-05-30 08:21:21 -05:00
|
|
|
script/poll-for-db
|
2018-05-29 20:14:19 -05:00
|
|
|
|
|
|
|
|
# Leaving this in since it will be needed for Rails 5
|
|
|
|
|
# bin/rails db:environment:set RAILS_ENV=test || true
|
|
|
|
|
|
2018-05-31 07:59:47 -05:00
|
|
|
bin/rake db:reset
|
2018-05-29 20:14:19 -05:00
|
|
|
bin/rake ci:lite
|
|
|
|
|
|