/
init.sh
executable file
·140 lines (123 loc) · 4.44 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
#!/bin/sh
DEMO="Install Demo"
AUTHORS="Andrew Block, Eric D. Schabell"
PROJECT="git@github.com:jbossdemocentral/bpms-install-demo.git"
PRODUCT="JBoss BPM Suite"
TARGET=./target
JBOSS_HOME=$TARGET/jboss-eap-7.0
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
BPMS=jboss-bpmsuite-6.4.0.GA-deployable-eap7.x.zip
EAP=jboss-eap-7.0.0-installer.jar
#EAP_PATCH=jboss-eap-6.4.4-patch.zip
VERSION=6.4
# wipe screen.
clear
echo
echo "#################################################################"
echo "## ##"
echo "## Setting up the ${DEMO} ##"
echo "## ##"
echo "## ##"
echo "## #### #### # # ### # # ##### ##### ##### ##"
echo "## # # # # # # # # # # # # # # ##"
echo "## #### #### # # # ## # # # # ### ##"
echo "## # # # # # # # # # # # ##"
echo "## #### # # # ### ##### ##### # ##### ##"
echo "## ##"
echo "## ##"
echo "## brought to you by, ##"
echo "## ${AUTHORS} ##"
echo "## ##"
echo "## ${PROJECT} ##"
echo "## ##"
echo "#################################################################"
echo
# make some checks first before proceeding.
if [ -r $SRC_DIR/$EAP ] || [ -L $SRC_DIR/$EAP ]; then
echo Product sources are present...
echo
else
echo Need to download $EAP package from http://developers.redhat.com
echo and place it in the $SRC_DIR directory to proceed...
echo
exit
fi
#if [ -r $SRC_DIR/$EAP_PATCH ] || [ -L $SRC_DIR/$EAP_PATCH ]; then
# echo Product patches are present...
# echo
#else
# echo Need to download $EAP_PATCH package from the Customer Portal
# echo and place it in the $SRC_DIR directory to proceed...
# echo
# exit
#fi
if [ -r $SRC_DIR/$BPMS ] || [ -L $SRC_DIR/$BPMS ]; then
echo Product sources are present...
echo
else
echo Need to download $BPMS package from http://developers.redhat.com
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
# Run installers.
echo "JBoss EAP installer running now..."
echo
java -jar $SRC_DIR/$EAP $SUPPORT_DIR/installation-eap -variablefile $SUPPORT_DIR/installation-eap.variables
if [ $? -ne 0 ]; then
echo
echo Error occurred during JBoss EAP installation!
exit
fi
#echo
#echo "Applying JBoss EAP 6.4.4 patch now..."
#echo
#$JBOSS_HOME/bin/jboss-cli.sh --command="patch apply $SRC_DIR/$EAP_PATCH"
#
#if [ $? -ne 0 ]; then
# echo
# echo Error occurred during JBoss EAP patching!
# exit
#fi
echo
echo "Deploying JBoss BPM Suite now..."
echo
unzip -qo $SRC_DIR/$BPMS -d $TARGET
#java -jar $SRC_DIR/$BPMS $SUPPORT_DIR/installation-bpms -variablefile $SUPPORT_DIR/installation-bpms.variables
if [ $? -ne 0 ]; then
echo
echo Error occurred during $PRODUCT installation!
exit
fi
echo
echo " - enabling demo accounts setup ..."
echo
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u bpmsAdmin -p bpmsuite1! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent
$JBOSS_HOME/bin/add-user.sh -a -r ApplicationRealm -u erics -p bpmsuite1! -ro analyst,admin,manager,user,kie-server,kiemgmt,rest-all --silent
echo " - setting up standalone.xml configuration adjustments..."
echo
cp $SUPPORT_DIR/standalone.xml $SERVER_CONF
echo " - setup email task notification users..."
echo
cp $SUPPORT_DIR/userinfo.properties $SERVER_DIR/business-central.war/WEB-INF/classes/
# 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 "You can now start the $PRODUCT with $SERVER_BIN/standalone.sh"
echo
echo "Login to http://localhost:8080/business-central (u:bpmsAdmin / p:bpmsuite1!)"
echo
echo "$PRODUCT $VERSION $DEMO Setup Complete."
echo