-
Notifications
You must be signed in to change notification settings - Fork 8
/
deploy-cloud-bridge.sh
122 lines (99 loc) · 1.93 KB
/
deploy-cloud-bridge.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
#!/usr/bin/env bash
# deploy.sh -- deploys a cloud-bridge
#
usage() {
printf "Usage: %s: -d [tomcat directory to deploy to] -z [zip file to use]\n" $(basename $0) >&2
}
dflag=
zflag=
tflag=
iflag=
deploydir=
typ=
#set -x
while getopts 'd:z:x:h:' OPTION
do
case "$OPTION" in
d) dflag=1
deploydir="$OPTARG"
;;
z) zflag=1
zipfile="$OPTARG"
;;
h) iflag="$OPTARG"
;;
?) usage
exit 2
;;
esac
done
if [ "$deploydir" == "" ]
then
if [ "$CATALINA_HOME" == "" ]
then
printf "Tomcat Directory to deploy to: "
read deploydir
else
deploydir="$CATALINA_HOME"
fi
fi
if [ "$deploydir" == "" ]
then
printf "Tomcat directory was not specified, please set CATALINA_HOME environment variable'\n";
exit 15;
fi
printf "Check to see if the Tomcat directory exist: $deploydir\n"
if [ ! -d $deploydir ]
then
printf "Tomcat directory does not exist\n";
exit 16;
fi
rm -rf $deploydir/webapps/bridge
mkdir "$CATALINA_HOME/temp"
mkdir "$CATALINA_HOME/webapps/bridge"
if ! unzip -o ./axis2.war -d $deploydir/webapps/bridge
then
exit 10;
fi
if ! cp -f services/* $deploydir/webapps/bridge/WEB-INF/services
then
exit 11;
fi
if ! cp -f modules/* $deploydir/webapps/bridge/WEB-INF/modules
then
exit 12;
fi
if ! cp -f rampart-lib/* $deploydir/webapps/bridge/WEB-INF/lib
then
exit 13;
fi
if ! cp -f cloud-bridge.jar $deploydir/webapps/bridge/WEB-INF/lib
then
exit 14;
fi
if ! cp -f lib/* $deploydir/lib
then
exit 17;
fi
if ! cp -n conf/* $deploydir/conf
then
exit 18;
fi
if ! cp -f classes/* $deploydir/webapps/bridge/WEB-INF/classes
then
exit 19;
fi
if ! cp -f web.xml $deploydir/webapps/bridge/WEB-INF
then
exit 20;
fi
if ! cp -f axis2.xml $deploydir/webapps/bridge/WEB-INF/conf
then
exit 21;
fi
if ! rm -rf $deploydir/webapps/bridge/WEB-INF/lib/dom4j-1.6.1.jar
then
exit 22;
fi
printf "Installation is now complete\n"
exit 0