forked from Juniper/contrail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestenv.sh
executable file
·38 lines (31 loc) · 1007 Bytes
/
testenv.sh
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
33
34
35
36
37
38
#!/bin/bash
set -e
SOURCEDIR=$( cd "$(dirname "$0")/../../../../.." ; pwd -P )
PASSWORD=contrail123
docker network create contrail || echo > /dev/null
docker rm -f contrail_postgres contrail_mysql contrail_etcd || echo > /dev/null
docker run -d --name contrail_postgres \
--net contrail \
-v $SOURCEDIR:/go \
-p 5432:5432 \
-e "POSTGRES_USER=root" \
-e "POSTGRES_PASSWORD=$PASSWORD" \
circleci/postgres:10.3-alpine -c 'wal_level=logical'
docker run -d --name contrail_mysql \
--net contrail \
-v $SOURCEDIR:/go \
-p 3306:3306 \
-e "MYSQL_ROOT_PASSWORD=$PASSWORD" \
circleci/mysql:5.7
docker run -d --name contrail_etcd \
--net contrail \
-p 2379:2379 \
gcr.io/etcd-development/etcd:v3.3.2 \
etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379
echo "Waiting for mysql"
until docker exec contrail_mysql mysql -uroot -p"$PASSWORD" -e "show status" &> /dev/null
do
printf "."
sleep 1
done
echo "done"