-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path1-install-ks.sh
executable file
·154 lines (127 loc) · 3.93 KB
/
1-install-ks.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
#!/bin/sh
PRODUCT="Red Hat Process Automation Manager 7.11.0 Kie Server on EAP 7.3"
RHPAM_KS=rhpam-7.11.1-kie-server-ee8
EAP=jboss-eap-7.3.0
EAP_PATCH=jboss-eap-7.3.5-patch
EAP_USER=admin
EAP_PWD=jboss1!
RHPAM_USER=pamAdmin
RHPAM_PWD=pamAdmin
TARGET=../
SRC_DIR=./installs
JBOSS_HOME=$TARGET/jboss-eap-7.3
RHPAM_HOME=$TARGET/rhpam-ks-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 "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_KS.zip ] || [ -L $SRC_DIR/$RHPAM_KS.zip ]; then
echo "Red Hat Product sources $RHPAM_KS.zip are present..."
echo
else
echo "Need to download $RHPAM_KS.zip package from the Customer Portal"
echo "and place it in the $SRC_DIR directory to proceed..."
exit
fi
# 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 $RHPAM_HOME ]; then
echo " - existing Red Hat product install detected in $RHPAM_HOME !"
echo " - existing Red Hat product install removed..."
echo
rm -rf $RHPAM_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_KS) now..."
echo
mkdir -p ./patch_tmp
# unzip -qo $SRC_DIR/$RHPAM_KS.zip -d $JBOSS_HOME/standalone/deployments
unzip -qo $SRC_DIR/$RHPAM_KS.zip -d ./patch_tmp
cp -rf ./patch_tmp/SecurityPolicy/. $JBOSS_HOME/bin/
cp -rf ./patch_tmp/kie-server.war $JBOSS_HOME/standalone/deployments/
touch $JBOSS_HOME/standalone/deployments/kie-server.war.dodeploy
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 -u $RHPAM_USER -p $RHPAM_PWD -ro admin,Administrators,kie-server,rest-all --silent
$JBOSS_HOME/bin/add-user.sh -a -u manager1 -p manager1 -ro manager,kie-server,rest-all --silent
$JBOSS_HOME/bin/add-user.sh -a -u user1 -p user1 -ro user,kie-server,rest-all --silent
if [ $? -ne 0 ]; then
echo
echo "Error occurred during EAP installation!"
exit
fi
echo
echo "Renaming folders ..."
echo
mv $JBOSS_HOME $RHPAM_HOME
echo "Now, start server in administration mode by running this command: ./standalone.sh -c standalone-full.xml --admin-only"