Files
opensnp.org-docker/test/run
Helge Rausch c3eef3525d Fix sidekiq init script (#13)
* Fix sidekiq init script

* Re-evaluate `git clone` if snpr's master changed

* Pass along SNPR_REV env var to docker

* Find out snpr commit hash if not passed in

* Only build "rails" image explicitly

* Make the sidekiq init script work

* Fix migrate init script

* Simplify Dockerfile
2018-01-19 11:18:05 -08:00

32 lines
589 B
Bash
Executable File

#!/usr/bin/env bash
POSTGRES_DATA_DIR=test/postgres-data
set -x
mkdir $POSTGRES_DATA_DIR
snpr_rev="$SNPR_REV"
if [ -z "$snpr_rev" ]; then
snpr_rev=$(git ls-remote https://github.com/opensnp/snpr master | cut -f 1)
fi
docker-compose build --build-arg SNPR_REV=$snpr_rev rails
docker-compose up -d
i=10
while
docker exec -ti opensnporgdocker_rails_1 bash -l -c 'bundle exec rake db:reset'
curl -sf "http://localhost:8080/" > /dev/null
status=$?
[ $status -ne 0 -a $i -gt 0 ]
do
sleep 1
i=$((i-1))
done
docker-compose rm -sfv
sudo rm -rf $POSTGRES_DATA_DIR
exit $status