forked from MassBank/MassBank-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·53 lines (49 loc) · 1.56 KB
/
install.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
#!/bin/bash
CURRENT_UID=$(id -u):$(id -g)
export CURRENT_UID
usage () {
echo "Usage: install.sh <operation> <instance>"
echo " <operation> ... start, stop, deploy or refresh"
echo " <instance> ... 0 to 9"
}
case $2 in
[0-9])
TAG=$2
export TAG
;;
*)
usage
exit 1
;;
esac
case $1 in
start)
docker-compose -f compose/full-service.yml -p $TAG pull
docker-compose -f compose/full-service.yml -p $TAG build
docker-compose -f compose/full-service.yml -p $TAG up -d mariadb
docker-compose -f compose/full-service.yml -p $TAG exec mariadb /root/waitforSQL.sh
CURRENT_UID=$(id -u):$(id -g) docker-compose -f compose/full-service.yml -p $TAG run --rm maven mvn -q -Duser.home=/var/maven -f /project clean package
docker-compose -f compose/full-service.yml -p $TAG up -d tomee
docker-compose -f compose/full-service.yml -p $TAG \
run --rm dbupdate \
/project/MassBank-lib/target/MassBank-lib/MassBank-lib/bin/RefreshDatabase
;;
stop)
docker-compose -f compose/full-service.yml -p $TAG rm -s
;;
refresh)
docker-compose -f compose/full-service.yml -p $TAG \
run --rm dbupdate \
/project/MassBank-lib/target/MassBank-lib/MassBank-lib/bin/RefreshDatabase
;;
deploy)
docker-compose -f compose/full-service.yml -p $TAG pull
CURRENT_UID=$(id -u):$(id -g) docker-compose -f compose/full-service.yml -p $TAG run --rm maven mvn -q -Duser.home=/var/maven -f /project clean package
docker-compose -f compose/full-service.yml -p $TAG rm -s tomee
docker-compose -f compose/full-service.yml -p $TAG up -d tomee
;;
*)
usage
exit 1
;;
esac