00d7dd62ce12230c98dc766cc633838761706080
[aai/babel.git] / src / main / bin / start.sh
1 #!/bin/sh
2
3 # ============LICENSE_START=======================================================
4 # org.onap.aai
5 # ================================================================================
6 # Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
7 # Copyright © 2017-2018 European Software Marketing Ltd.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12 #
13 #      http://www.apache.org/licenses/LICENSE-2.0
14 #
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END=========================================================
21
22 BASEDIR="/opt/app/babel/"
23 AJSC_HOME="$BASEDIR"
24
25 if [ -z "$CONFIG_HOME" ]; then
26         echo "CONFIG_HOME must be set in order to start up process"
27         exit 1
28 fi
29
30 foo () {
31 if [ -z "$KEY_STORE_PASSWORD" ]; then
32         echo "KEY_STORE_PASSWORD must be set in order to start up process"
33         exit 1
34 else
35         echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
36 fi
37
38 if [ -z "$KEY_MANAGER_PASSWORD" ]; then
39         echo "KEY_MANAGER_PASSWORD must be set in order to start up process"
40         exit 1
41 else
42         echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
43 fi
44 }
45
46 CLASSPATH="$AJSC_HOME/lib/*"
47 CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/"
48 CLASSPATH="$CLASSPATH:$AJSC_HOME/etc/"
49 PROPS="-DAJSC_HOME=$AJSC_HOME"
50 PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/"
51 PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml"
52 PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME"
53 PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=babel"
54 PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1"
55 PROPS="$PROPS -Dserver.port=9516"
56 PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME"
57 PROPS="$PROPS -Dartifactgenerator.config=$CONFIG_HOME/artifact-generator.properties"
58 JVM_MAX_HEAP=${MAX_HEAP:-1024}
59
60 echo $CLASSPATH
61
62 exec java -Xmx${JVM_MAX_HEAP}m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=// sslport=9516