-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrun.sh
executable file
·129 lines (109 loc) · 1.63 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/bin/sh
export COMPOSE_FILE="${PWD}/target/classes/docker-compose.yml"
if [ -z "${M2_HOME}" ]; then
export MVN_EXEC="mvn"
else
export MVN_EXEC="${M2_HOME}/bin/mvn"
fi
build() {
$MVN_EXEC clean package resources:resources -Dmaven.test.skip=true
}
build_resources() {
if [ ! -f "$COMPOSE_FILE" ]; then
$MVN_EXEC package -pl collabora-platform-extension-docker,collabora-share-extension-docker,collabora-aca-extension-docker
$MVN_EXEC resources:resources
fi
}
clean() {
$MVN_EXEC clean
}
down() {
if [ -f "$COMPOSE_FILE" ]; then
docker-compose down
fi
}
logs() {
docker-compose logs $1
}
purge() {
docker-compose down -v
}
ps() {
docker-compose ps
}
start() {
docker-compose up --build -d
}
tail() {
docker-compose logs -f
}
tail_all() {
docker-compose logs --tail="all"
}
build_resources
source "${PWD}/target/classes/run.sh"
case "$1" in
build)
build
;;
build_start)
down
build
start
tail
;;
build_start_it_supported)
down
build
prepare_test
start
tail
;;
build_test)
down
build
prepare_test
start
test
tail_all
down
;;
clean)
clean
;;
logs)
logs $2
;;
purge)
down
purge
;;
ps)
ps
;;
reload_share)
build_share
start_share
tail
;;
reload_acs)
build_acs
start_acs
tail
;;
start)
start
tail
;;
stop)
down
;;
tail)
tail
;;
test)
test
;;
*)
echo "Usage: $0 {build_start|build_start_it_supported|start|stop|purge|tail|reload_share|reload_acs|build_test|test}"
esac