forked from ctripcorp/vi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.sh
executable file
·75 lines (63 loc) · 1.07 KB
/
deploy.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
webappdir=$tomcatdir/webapps
uidir=cornerstone-web
codedir=cornerstone
examplePrjName=cornerstone-example
version=0
secpara=$2
CATALINA_PID=/tmp/tmp.pid
export CATALINA_PID
_compileweb(){
cd $uidir
gulp clean deploy build
cd ..
rm -rf $codedir/src/main/resources/cornerstone-web/*
mv $uidir/dist/* $codedir/src/main/resources/cornerstone-web/
for f in `find $codedir/src/main/resources/cornerstone-web/maps/* -name '*.map'`
do
echo '{}'> $f
done
for f in `find $codedir/src/main/resources/cornerstone-web/fonts/* -not -name '*.woff'`
do
echo '{}'> $f
done
}
_jar(){
_stop
#gradle clean build
case $secpara in
notest)
mvn clean install -Dmaven.test.skip=true
;;
*)
mvn clean install
;;
esac
rm -rf $webappdir/$examplePrjName-$version
mv $examplePrjName/target/$examplePrjName-$version.war $webappdir
$tomcatdir/bin/startup.sh
}
_deploy(){
_compileweb
_jar
}
_stop(){
$tomcatdir/bin/shutdown.sh -force
}
_restart(){
_stop
$tomcatdir/bin/startup.sh
}
case $1 in
stop)
_stop
;;
restart)
_restart
;;
jar)
_jar
;;
*)
_deploy
;;
esac