aboutsummaryrefslogtreecommitdiffstats
path: root/moonv4/bin/start.sh
blob: d72baf6149382a43b864dbfa34e0d857f149a3c1 (plain)
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
#!/usr/bin/env bash

echo -e "\033[31mDeleting previous dockers\033[m"
docker rm -f $(docker ps -a | grep moon | cut -d " " -f 1) 2>/dev/null
docker rm -f messenger db keystone 2>/dev/null

echo -e "\033[32mStarting Messenger\033[m"
docker run -dti --net=moon --hostname messenger --name messenger -e RABBITMQ_DEFAULT_USER=moon -e RABBITMQ_DEFAULT_PASS=p4sswOrd1 -e RABBITMQ_NODENAME=rabbit@messenger -e RABBITMQ_DEFAULT_VHOST=moon -e RABBITMQ_HIPE_COMPILE=1 -p 5671:5671 -p 5672:5672 -p 8080:15672 rabbitmq:3-management

echo -e "\033[32mStarting DB manager\033[m"
docker run -dti --net=moon --hostname db        --name db        -e MYSQL_ROOT_PASSWORD=p4sswOrd1 -e MYSQL_DATABASE=moon -e MYSQL_USER=moon -e MYSQL_PASSWORD=p4sswOrd1 -p 3306:3306 mysql:latest

echo "waiting for Database (it may takes time)..."
echo -e "\033[35m"
sed '/ready for connections/q' <(docker logs db -f)
echo -e "\033[m"

echo "waiting for Messenger (it may takes time)..."
echo -e "\033[35m"
sed '/Server startup complete;/q' <(docker logs messenger -f)
echo -e "\033[m"

docker run -dti --net moon --hostname keystone  --name keystone  -e DB_HOST=db -e DB_PASSWORD_ROOT=p4sswOrd1 -p 35357:35357 -p 5000:5000 keystone:mitaka

echo -e "\033[32mBuilding packages\033[m"
bash $MOON_HOME/bin/build_all.sh

. $MOON_HOME/moon_orchestrator/tests/venv/bin/activate

pip install $MOON_HOME/moon_orchestrator/dist/moon_db-0.1.0.tar.gz --upgrade
pip install $MOON_HOME/moon_orchestrator/dist/moon_utilities-0.1.0.tar.gz --upgrade
moon_db_manager upgrade

echo -e "\033[32mStarting Moon Orchestrator\033[m"
moon_orchestrator