-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-install-on-eap7.1.sh
executable file
·191 lines (158 loc) · 4.55 KB
/
1-install-on-eap7.1.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
191
#!/bin/sh
AUTHORS1="Rachid Snoussi"
PRODUCT="Red Hat Process Automation Manager 7.0 on EAP7.1"
RHPAM_BC=rhpam-7.0.1-business-central-eap7-deployable
RHPAM_PS=rhpam-7.0.1-kie-server-ee7
#RHPAM_PATCH_WILDCARD=
EAP=jboss-eap-7.1.0
EAP_PATCH=jboss-eap-7.1.3-patch
EAP_USER=admin
EAP_PWD=jboss1!
RHPAM_USER=pamAdmin
RHPAM_PWD=pamAdmin1!
TARGET=../
SRC_DIR=./installs
JBOSS_HOME=$TARGET/jboss-eap-7.1
RHPAM_HOME=$TARGET/rhpam-7.0.1
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 "Red Hat 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 "Red Hat 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/$RHPAM_BC.zip ] || [ -L $SRC_DIR/$RHPAM_BC.zip ]; then
echo "Red Hat Product sources $RHPAM_BC.zip are present..."
echo
else
echo "Need to download $RHPAM_BC.zip package from the Customer Portal"
echo "and place it in the $SRC_DIR directory to proceed..."
exit
fi
if [ -r $SRC_DIR/$RHPAM_PS.zip ] || [ -L $SRC_DIR/$RHPAM_PS.zip ]; then
echo "Red Hat Product sources $RHPAM_PS.zip are present..."
echo
else
echo "Need to download $RHPAM_PS.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/$RHPAM_PATCH_WILDCARD); do
# if [ -r $f ] || [ -L $f ]; then
# echo "Red Hat Product patches $f are present..."
# fi
#done
# Remove the old Red Hat instance, if it exists.
if [ -x $JBOSS_HOME ]; then
echo " - existing Red Hat product install detected in $JBOSS_HOME !"
echo " - existing Red Hat product install removed..."
echo
rm -rf $JBOSS_HOME
fi
if [ -x ./patch_tmp ]; then
echo " - existing Red Hat product patch_tmp detected and removed..."
echo
rm -rf ./patch_tmp
fi
# Install EAP
echo
echo "EAP installer running now..."
echo
unzip -qo $SRC_DIR/$EAP.zip -d $TARGET
if [ $? -ne 0 ]; then
echo
echo "Error occurred during EAP installation!"
exit
fi
# Add a default admin user.
echo
echo "Adding a default admin user on EAP ..."
echo
$JBOSS_HOME/bin/add-user.sh $EAP_USER $EAP_PWD --silent
if [ $? -ne 0 ]; then
echo
echo "Error occurred during 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 EAP patching!"
exit
fi
echo
echo "Deploying $PRODUCT ($RHPAM_BC) now..."
echo
unzip -qo $SRC_DIR/$RHPAM_BC.zip -d $TARGET
if [ $? -ne 0 ]; then
echo
echo "Error occurred during $PRODUCT installation!"
exit
fi
echo
echo "Deploying $PRODUCT ($RHPAM_PS) now..."
echo
unzip -qo $SRC_DIR/$RHPAM_PS.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 $RHPAM_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 $RHPAM_USER -p $RHPAM_PWD -ro admin,analyst,user,kie-server,rest-all,Administrators --silent
if [ $? -ne 0 ]; then
echo
echo "Error occurred during EAP installation!"
exit
fi
echo
echo "Renaming folders ..."
echo
mv $JBOSS_HOME $RHPAM_HOME
cp reset-bc.sh $RHPAM_HOME
cp reset-db.sh $RHPAM_HOME