-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathinit.sh
executable file
·241 lines (208 loc) · 9.41 KB
/
init.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
#!/bin/sh
DEMO="Install Demo"
AUTHORS="Red Hat"
PROJECT="[email protected]:jbossdemocentral/rhpam7-install-demo.git"
PRODUCT="Red Hat Process Automation Manager"
JBOSS_HOME=./target/jboss-eap-7.3
SERVER_DIR=$JBOSS_HOME/standalone/deployments
SERVER_CONF=$JBOSS_HOME/standalone/configuration/
SERVER_BIN=$JBOSS_HOME/bin
SRC_DIR=./installs
SUPPORT_DIR=./support
PRJ_DIR=./projects
VERSION_EAP=7.3.0
VERSION=7.11.0
EAP=jboss-eap-$VERSION_EAP.zip
RHPAM=rhpam-$VERSION-business-central-eap7-deployable.zip
RHPAM_KIE_SERVER=rhpam-$VERSION-kie-server-ee8.zip
RHPAM_ADDONS=rhpam-$VERSION-add-ons.zip
RHPAM_CASE=rhpam-$VERSION-case-mgmt-showcase-eap7-deployable.zip
# wipe screen.
clear
echo
echo "###################################################################"
echo "## ##"
echo "## Setting up the ##"
echo "## ##"
echo "## #### ##### #### # # ### ##### ##"
echo "## # # # # # # # # # # ##"
echo "## #### ### # # ##### ##### # ##"
echo "## # # # # # # # # # # ##"
echo "## # # ##### #### # # # # # ##"
echo "## ##"
echo "## #### #### ### #### ##### #### #### ##"
echo "## # # # # # # # # # # ##"
echo "## #### #### # # # ### ### ### ##"
echo "## # # # # # # # # # ##"
echo "## # # # ### #### ##### #### #### ##"
echo "## ##"
echo "## ### # # ##### ### # # ### ##### ##### ### # # ##"
echo "## # # # # # # # ## ## # # # # # # ## # ##"
echo "## ##### # # # # # # # # ##### # # # # # # # ##"
echo "## # # # # # # # # # # # # # # # # ## ##"
echo "## # # ##### # ### # # # # # ##### ### # # ##"
echo "## ##"
echo "## # # ### # # ### ##### ##### #### ##"
echo "## ## ## # # ## # # # # # # # ##"
echo "## # # # ##### # # # ##### # ## ### #### ##"
echo "## # # # # # ## # # # # # # # ##"
echo "## # # # # # # # # ##### ##### # # ##"
echo "## ##"
echo "## brought to you by, ${AUTHORS} ##"
echo "## ##"
echo "## ${PROJECT} ##"
echo "## ##"
echo "###################################################################"
echo
# make some checks first before proceeding.
if [ -r $SUPPORT_DIR ] || [ -L $SUPPORT_DIR ]; then
echo "Support dir is presented..."
echo
else
echo "$SUPPORT_DIR wasn't found. Please make sure to run this script inside the demo directory."
echo
exit
fi
if [ -r $SRC_DIR/$EAP ] || [ -L $SRC_DIR/$EAP ]; then
echo "Product EAP sources are present..."
echo
else
echo "Need to download $EAP package from https://developers.redhat.com/products/eap/download"
echo "and place it in the $SRC_DIR directory to proceed..."
echo
exit
fi
if [ -r $SRC_DIR/$RHPAM ] || [ -L $SRC_DIR/$RHPAM ]; then
echo "Product Red Hat Process Automation Manager sources are present..."
echo
else
echo "Need to download $RHPAM package from https://developers.redhat.com/products/rhpam/download"
echo "and place it in the $SRC_DIR directory to proceed..."
echo
exit
fi
if [ -r $SRC_DIR/$RHPAM_KIE_SERVER ] || [ -L $SRC_DIR/$RHPAM_KIE_SERVER ]; then
echo "Product Red Hat Process Automation Manager KIE Server sources are present..."
echo
else
echo "Need to download $RHPAM_KIE_SERVER package from https://developers.redhat.com/products/rhpam/download"
echo "and place it in the $SRC_DIR directory to proceed..."
echo
exit
fi
if [ -r $SRC_DIR/$RHPAM_ADDONS ] || [ -L $SRC_DIR/$RHPAM_ADDONS ]; then
echo "Product Red Hat Process Automation Manager Case Management sources are present..."
echo
else
echo "Need to download $RHPAM_ADDONS package from https://developers.redhat.com/products/rhpam/download"
echo "and place it in the $SRC_DIR directory to proceed..."
echo
exit
fi
# Remove the old JBoss instance, if it exists.
if [ -x $JBOSS_HOME ]; then
echo " - removing existing JBoss product..."
echo
rm -rf $JBOSS_HOME
fi
# Installation.
echo "JBoss EAP installation running now..."
echo
mkdir -p ./target
unzip -qo $SRC_DIR/$EAP -d target
if [ $? -ne 0 ]; then
echo
echo Error occurred during JBoss EAP installation!
exit
fi
echo "Red Hat Process Automation Manager installation running now..."
echo
unzip -qo $SRC_DIR/$RHPAM -d target
if [ $? -ne 0 ]; then
echo
echo Error occurred during Red Hat Process Manager installation!
exit
fi
echo "Red Hat Process Automation Manager Kie Server installation running now..."
echo
unzip -qo $SRC_DIR/$RHPAM_KIE_SERVER -d $JBOSS_HOME/standalone/deployments
if [ $? -ne 0 ]; then
echo
echo Error occurred during Red Hat Process Manager Kie Server installation!
exit
fi
# Set deployment Kie Server.
touch $JBOSS_HOME/standalone/deployments/kie-server.war.dodeploy
echo "Red Hat Process Automation Manager Case Management installation running now..."
echo
unzip -qo $SRC_DIR/$RHPAM_ADDONS $RHPAM_CASE -d $SRC_DIR
unzip -qo $SRC_DIR/$RHPAM_CASE -d target
rm $SRC_DIR/$RHPAM_CASE
if [ $? -ne 0 ]; then
echo
echo Error occurred during Red Hat Process Manager Case Management installation!
exit
fi
# Set deployment Case Management.
touch $JBOSS_HOME/standalone/deployments/rhpam-case-mgmt-showcase.war.dodeploy
echo " - enabling demo accounts role setup..."
echo
echo " - adding user 'pamAdmin' with password 'redhatpam1!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u pamAdmin -p redhatpam1! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent
echo " - adding user 'adminUser' with password 'test1234!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u adminUser -p test1234! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent
echo " - adding user 'kieserver' with password 'kieserver1!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u kieserver -p kieserver1! -ro kie-server,rest-all --silent
echo " - adding user 'caseUser' with password 'redhatpam1!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseUser -p redhatpam1! -ro user --silent
echo " - adding user 'caseManager' with password 'redhatpam1!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseManager -p redhatpam1! -ro user,manager --silent
echo " - adding user 'caseSupplier' with password 'redhatpam1!'..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u caseSupplier -p redhatpam1! -ro user,supplier --silent
echo " - setting up standalone.xml configuration adjustments..."
echo
cp $SUPPORT_DIR/standalone-full.xml $SERVER_CONF/standalone.xml
echo " - setup email task notification users..."
echo
cp $SUPPORT_DIR/userinfo.properties $SERVER_DIR/business-central.war/WEB-INF/classes/
echo " - setup system property for jpa marshaller"
echo
$JBOSS_HOME/bin/jboss-cli.sh <<EOT
embed-server
/system-property=org.kie.server.xstream.enabled.packages:add(value="org.drools.persistence.jpa.marshaller.*")
EOT
# Add execute permissions to the standalone.sh script.
echo " - making sure standalone.sh for server is executable..."
echo
chmod u+x $JBOSS_HOME/bin/standalone.sh
echo "=============================================================="
echo "= ="
echo "= $PRODUCT $VERSION setup complete. ="
echo "= ="
echo "= Start $PRODUCT with: ="
echo "= ="
echo "= $SERVER_BIN/standalone.sh ="
echo "= ="
echo "= Log in to Red Hat Process Automation Manager to start ="
echo "= developing rules projects: ="
echo "= ="
echo "= http://localhost:8080/business-central ="
echo "= ="
echo "= Log in: [ u:pamAdmin / p:redhatpam1! ] ="
echo "= ="
echo "= http://localhost:8080/rhpam-case-mgmt-showcase ="
echo "= ="
echo "= Others: ="
echo "= [ u:kieserver / p:kieserver1! ] ="
echo "= [ u:caseUser / p:redhatpam1! ] ="
echo "= [ u:caseManager / p:redhatpam1! ] ="
echo "= [ u:caseSupplier / p:redhatpam1! ] ="
echo "= ="
echo "=============================================================="
echo