Fix the docker build error for vfc-nfvo-wfengine
[vfc/nfvo/wfengine.git] / wfenginemgrservice / src / main / docker / bin / run.sh
1 #
2 # Copyright 2017 ZTE Corporation.
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 DIRNAME=`dirname $0`
18 RUNHOME=`cd $DIRNAME/; pwd`
19 echo @RUNHOME@ $RUNHOME
20
21 if [ -z "$1" ]; then
22     dwApp_msbClientConfig_msbSvrIp="127.0.0.1"
23 elif [ "$OPENPALETTE_MSB_IP" ]; then
24     dwApp_msbClientConfig_msbSvrIp=$OPENPALETTE_MSB_IP
25 else
26     dwApp_msbClientConfig_msbSvrIp=$1
27 fi
28 if [ -z "$2" ]; then
29     dwApp_msbClientConfig_msbSvrPort="80"
30 elif [ "$OPENPALETTE_MSB_PORT" ]; then
31     dwApp_msbClientConfig_msbSvrPort=$OPENPALETTE_MSB_PORT
32 else
33     dwApp_msbClientConfig_msbSvrPort=$2
34 fi
35 echo " dwApp_MSB_ADDR=${dwApp_msbClientConfig_msbSvrIp}:${dwApp_msbClientConfig_msbSvrPort}"
36
37 sed -i "s/127.0.0.1/$dwApp_msbClientConfig_msbSvrIp/g" ./conf/workflow.yml
38 sed -i "s/80/$dwApp_msbClientConfig_msbSvrPort/g" ./conf/workflow.yml
39
40 if [ -f "$RUNHOME/setenv.sh" ]; then
41     "$RUNHOME/setenv.sh"
42 else
43     echo "can not found $RUNHOME/setenv.sh"
44 fi
45
46 echo ================== ENV_INFO  =============================================
47 echo @RUNHOME@  $RUNHOME
48 echo @Main_Class@  $Main_Class
49 echo @APP_INFO@  $APP_INFO
50 echo @Main_JAR@  $Main_JAR
51 echo @Main_Conf@ $Main_Conf
52 echo ==========================================================================
53
54 echo start $APP_INFO ...
55
56 JAVA="$JAVA_HOME/bin/java"
57 JAVA_OPTS="-Xms50m -Xmx128m"
58 #port=26000
59 #JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=$port,server=y,suspend=n"
60 CLASS_PATH="$EXT_DIRS:$RUNHOME/:$RUNHOME/$Main_JAR"
61
62 echo ================== RUN_INFO  =============================================
63 echo @JAVA_HOME@ $JAVA_HOME
64 echo @JAVA@ $JAVA
65 echo @JAVA_OPTS@ $JAVA_OPTS
66 echo @CLASS_PATH@ $CLASS_PATH
67 echo @EXT_DIRS@ $EXT_DIRS
68 echo ==========================================================================
69
70 echo `env`
71
72 echo @JAVA@ $JAVA
73 echo @JAVA_CMD@
74 "$JAVA" $JAVA_OPTS -classpath "$CLASS_PATH" $Main_Class server "$RUNHOME/$Main_Conf"
75