-
Notifications
You must be signed in to change notification settings - Fork 0
/
degub.sh
executable file
·63 lines (52 loc) · 1.21 KB
/
degub.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
if [[ $(docker ps -aqf "name=bg-redis") ]]; then
echo "Redis container already exists. Starting it..."
docker container start bg-redis
else
echo "Redis container does not exist. Creating and starting it..."
docker container run -d --name bg-redis -p 6379:6379 redis
fi
if [[ $(docker ps -aqf "name=bg-mongo") ]]; then
echo "Mongo container already exists. Starting it..."
docker container start bg-mongo
else
echo "Mongo container does not exist. Creating and starting it..."
docker container run -d --name bg-mongo -p 27017:27017 redis
fi
yarn
yarn build
echo "Starting bot-aws..."
node dist/apps/bot-aws/main &
bot_aws_pid=$!
echo " ^"
echo " / \\"
echo " /___\\"
echo " | |"
echo " | B |"
echo " | I |"
echo " | G |"
echo " | O |"
echo " | |"
echo " B O T"
echo " | |"
echo " |_ _|"
node dist/apps/bot-gateway/main &
bot_gateway_pid=$!
echo "Starting bot-gateway..."
while ! curl -s http://localhost:3000 >/dev/null; do
sleep 1
done
echo " ^"
echo " / \\"
echo " /___\\"
echo " | |"
echo " | B |"
echo " | I |"
echo " | G |"
echo " | O |"
echo " | |"
echo " | |"
echo "| GATEWAY |"
echo " |_ _|"
trap 'kill $bot_aws_pid $bot_gateway_pid' INT
wait