Ricardo Jun
2018-11-22 f85af335628c1f2e9376304420ce69a977cfa34b
commit | author | age
9e7a28 1 #!/bin/sh
RJ 2
3 # Purpose of this run script is to append additional execution of JBoss CLI to $JBOSS_HOME/bin/openshift-launch.sh
4 # This additional JBoss CLI needs to be executed after standalone-openshift.xml is modified and before exec-server is started.
5
6 # Please refer to the following source code to understand the out of box start-up configs and scripts of the BPM exec server:
7 #  1)  https://github.com/jboss-openshift/cct_module/blob/master/os-bpmsuite-executionserver/added/openshift-launch.sh
8 #  2)  https://github.com/jboss-openshift/cct_module/blob/master/os-eap71-openshift/added/standalone-openshift.xml#L533-L546
9
10 RUN_LOG_FILE=/tmp/run.log
11
12 echo "Files in /data as follows:" >> $RUN_LOG_FILE
13 ls -lt /data >> $RUN_LOG_FILE
14
15 # 1) grab originl exec line in openshift-launch.sh and then comment it out
16 exec_line=`cat $JBOSS_HOME/bin/openshift-launch.sh | grep "exec env"`
17 sed -i -e 's/^exec/#exec/' $JBOSS_HOME/bin/openshift-launch.sh
18
19 # 2) Append new commands
20
21 echo "
22 RUN_LOG_FILE=$RUN_LOG_FILE
23
24 \$JBOSS_HOME/bin/standalone.sh --admin-only -c standalone-openshift.xml &
25 sleep 15
26
27 \$JBOSS_HOME/bin/jboss-cli.sh -c "version" >> \$RUN_LOG_FILE
28
29 \$JBOSS_HOME/bin/jboss-cli.sh -c --file=/data/undertow-cors.cli >> \$RUN_LOG_FILE
30 \$JBOSS_HOME/bin/jboss-cli.sh -c ":shutdown" >> \$RUN_LOG_FILE
31 sleep 5
32
33 $exec_line" >> $JBOSS_HOME/bin/openshift-launch.sh
34
35 echo "Done modifying jboss" >> $RUN_LOG_FILE
36
37
38 exec $JBOSS_HOME/bin/openshift-launch.sh