-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
55 lines (44 loc) · 1.22 KB
/
run.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
#!/bin/bash
#author Manjunath Asundi
declare project_dir=$(dirname $0)
declare dc_main=${project_dir}/docker-compose.yml
function restart() {
stop_all
start_all
}
function start() {
echo "Starting $1...."
build_api
docker-compose -f ${dc_main} up --build --force-recreate -d $1
docker-compose -f ${dc_main} logs -f
}
function stop() {
echo "Stopping $1...."
docker-compose -f ${dc_main} stop
docker-compose -f ${dc_main} rm -f
}
function start_infra() {
echo "Starting mysqldb rabbitmq setup-vault config-server service-registry hystrix-dashboard...."
docker-compose -f ${dc_main} up --build --force-recreate -d mysqldb rabbitmq setup-vault config-server service-registry hystrix-dashboard
docker-compose -f ${dc_main} logs -f
}
function start_all() {
echo "Starting all services...."
build_api
docker-compose -f ${dc_main} up --build --force-recreate -d
docker-compose -f ${dc_main} logs -f
}
function stop_all() {
echo 'Stopping all services....'
docker-compose -f ${dc_main} stop
docker-compose -f ${dc_main} rm -f
}
function build_api() {
./mvnw clean package -DskipTests
}
action="start_all"
if [[ "$#" != "0" ]]
then
action=$@
fi
eval ${action}