2016-01-15 21:33:30 +03:00
|
|
|
#!/bin/bash
|
2016-11-04 04:05:50 +03:00
|
|
|
#
|
|
|
|
# Integartion testing with dockerized Postgres servers
|
|
|
|
#
|
|
|
|
# Boot2Docker is deprecated and no longer supported.
|
|
|
|
# Requires Docker for Mac to run on OSX.
|
|
|
|
# Install: https://docs.docker.com/engine/installation/mac/
|
|
|
|
#
|
2016-01-15 21:33:30 +03:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2016-11-04 04:05:50 +03:00
|
|
|
export PGHOST=${PGHOST:-localhost}
|
2016-01-15 21:33:30 +03:00
|
|
|
export PGUSER="postgres"
|
|
|
|
export PGPASSWORD=""
|
|
|
|
export PGDATABASE="booktown"
|
2016-01-15 21:44:21 +03:00
|
|
|
export PGPORT="15432"
|
2016-01-15 21:33:30 +03:00
|
|
|
|
2016-06-15 19:40:01 +03:00
|
|
|
for i in {1..6}
|
2016-01-15 21:33:30 +03:00
|
|
|
do
|
|
|
|
export PGVERSION="9.$i"
|
2016-11-04 04:05:50 +03:00
|
|
|
|
|
|
|
echo "---------------- BEGIN TEST ----------------"
|
2016-01-15 21:33:30 +03:00
|
|
|
echo "Running tests against PostgreSQL v$PGVERSION"
|
|
|
|
docker rm -f postgres || true
|
2016-01-15 21:44:21 +03:00
|
|
|
docker run -p $PGPORT:5432 --name postgres -e POSTGRES_PASSWORD=$PGPASSWORD -d postgres:$PGVERSION
|
2016-01-15 21:33:30 +03:00
|
|
|
sleep 5
|
|
|
|
make test
|
2016-11-04 04:05:50 +03:00
|
|
|
echo "---------------- END TEST ------------------"
|
2016-01-15 21:33:30 +03:00
|
|
|
done
|