forked from zalando-stups/java-sproc-wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·32 lines (25 loc) · 775 Bytes
/
Copy pathtest.sh
File metadata and controls
executable file
·32 lines (25 loc) · 775 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
if nc -w 5 -z localhost 5432; then
echo 'There is already some process listening on port 5432.'
echo 'Please shutdown any existing PostgreSQL instance and re-run this script.'
exit 1
fi
export PGHOST=localhost
export PGUSER=postgres
export PGPASSWORD=postgres
export PGDATABASE=local_zmon_db
container=$(docker ps | grep postgres:9.3.5)
if [ -z "$container" ]; then
docker rm postgres
echo 'Starting PostgreSQL instance..'
docker run --name postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -d postgres:9.3.5
fi
until nc -w 5 -z localhost 5432; do
echo 'Waiting for Postgres port..'
sleep 3
done
sleep 5
echo 'Running tests..'
mvn clean verify -Pintegration-test
echo 'Stopping PostgreSQL instance..'
docker stop postgres