-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·190 lines (157 loc) · 4.6 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
#!/bin/sh
PRODUCT="Red Hat Decision Manager 7.11 on EAP 7.3"
RHDM_DC=rhdm-7.11.1-decision-central-eap7-deployable
RHDM_DS=rhdm-7.11.1-kie-server-ee8
#RHDM_PATCH_WILDCARD=
EAP=jboss-eap-7.3.0
#EAP_PATCH=jboss-eap-7.1.4-patch
EAP_USER=admin
EAP_PWD=jboss
RHDM_USER=dmAdmin
RHDM_PWD=dmAdmin
TARGET=../
SRC_DIR=./installs
JBOSS_HOME=$TARGET/jboss-eap-7.3
RHDM_HOME=$TARGET/rhdm-7.11
echo
echo "##############################################################"
echo "## ##"
echo " Installing ${PRODUCT}"
echo "## ##"
echo "## ##"
echo "##############################################################"
echo
# make some checks first before proceeding.
if [ -r $SRC_DIR/$EAP.zip ] || [ -L $SRC_DIR/$EAP.zip ]; then
echo "JBoss Product sources $EAP are present..."
echo
else
echo "Need to download $EAP.zip package from the Customer Portal"
echo "and place it in the $SRC_DIR directory to proceed..."
echo
exit
fi
# if [ -r $SRC_DIR/$EAP_PATCH.zip ] || [ -L $SRC_DIR/$EAP_PATCH.zip ]; then
# echo "JBoss Product patches $EAP_PATCH.zip are present..."
# echo
# else
# echo "Need to download $EAP_PATCH.zip package from the Customer Portal"
# echo "and place it in the $SRC_DIR directory to proceed..."
# echo
# exit
# fi
if [ -r $SRC_DIR/$RHDM_DC.zip ] || [ -L $SRC_DIR/$RHDM_DC.zip ]; then
echo "JBoss Product sources $RHDM_DC.zip are present..."
echo
else
echo "Need to download $RHDM_DC.zip package from the Customer Portal"
echo "and place it in the $SRC_DIR directory to proceed..."
exit
fi
if [ -r $SRC_DIR/$RHDM_DS.zip ] || [ -L $SRC_DIR/$RHDM_DS.zip ]; then
echo "JBoss Product sources $RHDM_DS.zip are present..."
echo
else
echo "Need to download $RHDM_DS.zip package from the Customer Portal"
echo "and place it in the $SRC_DIR directory to proceed..."
exit
fi
# "Need to download all patch package from the Customer Portal and place it in the $SRC_DIR directory ..."
#for f in $(ls $SRC_DIR/$RHDM_PATCH_WILDCARD); do
# if [ -r $f ] || [ -L $f ]; then
# echo "JBoss Product patches $f are present..."
# fi
#done
# Remove the old JBoss instance, if it exists.
if [ -x $JBOSS_HOME ]; then
echo " - existing JBoss product install detected in $JBOSS_HOME !"
echo " - existing JBoss product install removed..."
echo
rm -rf $JBOSS_HOME
fi
if [ -x ./patch_tmp ]; then
echo " - existing JBoss product patch_tmp detected and removed..."
echo
rm -rf ./patch_tmp
fi
# Install EAP
echo
echo "JBoss EAP installer running now..."
echo
unzip -qo $SRC_DIR/$EAP.zip -d $TARGET
if [ $? -ne 0 ]; then
echo
echo "Error occurred during JBoss EAP installation!"
exit
fi
# Add a default admin user.
echo
echo "Adding a default admin user on JBoss EAP ..."
echo
$JBOSS_HOME/bin/add-user.sh $EAP_USER $EAP_PWD --silent
if [ $? -ne 0 ]; then
echo
echo "Error occurred during JBoss EAP installation!"
exit
fi
# echo
# echo "Applying $EAP_PATCH.zip patch now..."
# echo
# $JBOSS_HOME/bin/jboss-cli.sh --command="patch apply $SRC_DIR/$EAP_PATCH.zip --override-all"
# if [ $? -ne 0 ]; then
# echo
# echo "Error occurred during JBoss EAP patching!"
# exit
# fi
echo
echo "Deploying $PRODUCT ($RHDM_DC) now..."
echo
unzip -qo $SRC_DIR/$RHDM_DC.zip -d $TARGET
if [ $? -ne 0 ]; then
echo
echo "Error occurred during $PRODUCT installation!"
exit
fi
echo
echo "Deploying $PRODUCT ($RHDM_DS) now..."
echo
unzip -qo $SRC_DIR/$RHDM_DS.zip -d $JBOSS_HOME/standalone/deployments
if [ $? -ne 0 ]; then
echo
echo "Error occurred during $PRODUCT installation!"
exit
fi
touch $JBOSS_HOME/standalone/deployments/kie-server.war.dodeploy
# echo
# echo "Applying patches on $PRODUCT now..."
# echo
# mkdir -p ./patch_tmp
# cd $SRC_DIR
# for f in $RHDM_PATCH_WILDCARD; do
# echo " >>> Applying $f ...";
# unzip -qo $f -d ../patch_tmp ;
# (cd ../patch_tmp/${f%????} && exec ./apply-updates.sh ../../$JBOSS_HOME eap7.x);
# done
# cd ..
# rm -rf ./patch_tmp
# if [ $? -ne 0 ]; then
# echo
# echo "Error occurred during $PRODUCT installation!"
# exit
# fi
# Create initial users
echo
echo "Creating initial users ..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u $RHDM_USER -p $RHDM_PWD -ro admin,analyst,kie-server,rest-all --silent
if [ $? -ne 0 ]; then
echo
echo "Error occurred during JBoss EAP installation!"
exit
fi
echo
echo "Renaming folders ..."
echo
mv $JBOSS_HOME $RHDM_HOME
cp reset-dc.sh $RHDM_HOME
echo "Now, start server in administration mode by running this command: ./standalone.sh -c standalone-full.xml --admin-only"