mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-21 21:40:48 +02:00

This commit fixes the Docker setup and also the CI build. Also the contributing guide is updated with the new information related to Docker. The CONTRIBUTING.md file is used to comply with GitHub guidelines to help other developers to contribute.
33 lines
556 B
Bash
Executable file
33 lines
556 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
docker_compose="docker-compose --file docker-compose.yml"
|
|
|
|
function cleanup() {
|
|
$docker_compose down
|
|
}
|
|
|
|
function die() {
|
|
echo $@
|
|
exit 1
|
|
}
|
|
|
|
|
|
trap cleanup EXIT
|
|
|
|
export RAILS_ENV=test
|
|
export TRACKS_DB=tracks_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
|
|
script/poll-for-db
|
|
|
|
# Leaving this in since it will be needed for Rails 5
|
|
bin/rails db:environment:set RAILS_ENV=test || true
|
|
|
|
bin/rake db:reset
|
|
bin/rake test
|
|
|