mirror of
https://github.com/chenasraf/opensnp.org-docker.git
synced 2026-05-17 17:48:10 +00:00
* Reduce number of places where Ruby versions are specified * Add TravisCI config * Let's see which Ruby the app user uses * Set Ruby version as app user * Use full path for calling rvm * Same but different * Use rvm Ruby throughout * Try setting up Postgres on TravisCI * Remove passenger_ruby nginx directive It should be the default... maybe... * fixup! Try setting up Postgres on TravisCI * Use Docker Compose * Don't wait 10 seconds * Try multiple times before drawing conclusions * Explicitly set a password for postgres * Try pruning volumes * Also retry db setup if request failed * Do we actually need to build before up? * Move empty lines around * Turns out, no sudo needed
25 lines
394 B
Bash
Executable File
25 lines
394 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
POSTGRES_DATA_DIR=test/postgres-data
|
|
|
|
set -x
|
|
|
|
mkdir $POSTGRES_DATA_DIR
|
|
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
|
|
rm -rf $POSTGRES_DATA_DIR
|
|
|
|
exit $status
|