3 # ============LICENSE_START==========================================
5 # ===================================================================
6 # Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7 # Copyright © 2017 Amdocs
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
13 # http://www.apache.org/licenses/LICENSE-2.0
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 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
25 BASEDIR="/opt/app/champ-service/"
27 AJSC_CONF_HOME="$AJSC_HOME/bundleconfig/"
29 if [ -z "$CONFIG_HOME" ]; then
30 echo "CONFIG_HOME must be set in order to start up process"
34 if [ -z "$KEY_STORE_PASSWORD" ]; then
35 echo "KEY_STORE_PASSWORD must be set in order to start up process"
38 echo "KEY_STORE_PASSWORD=$KEY_STORE_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
41 if [ -z "$KEY_MANAGER_PASSWORD" ]; then
42 echo "KEY_MANAGER_PASSWORD must be set in order to start up process"
45 echo "KEY_MANAGER_PASSWORD=$KEY_MANAGER_PASSWORD\n" >> $AJSC_CONF_HOME/etc/sysprops/sys-props.properties
48 # Add any spring bean configuration files to the Gizmo deployment
49 if [ -n "$SERVICE_BEANS" ]; then
50 echo "Adding the following dynamic service beans to the deployment: "
51 mkdir -p /tmp/champ-service/v1/conf
52 for f in `ls $SERVICE_BEANS`
54 cp $SERVICE_BEANS/$f /tmp/champ-service/v1/conf
55 echo "Adding dynamic service bean $SERVICE_BEANS/$f"
57 jar uf /opt/app/champ-service/services/champ-service_v1.zip* -C /tmp/ champ-service
58 rm -rf /tmp/champ-service
61 CLASSPATH="$AJSC_HOME/lib/*"
62 CLASSPATH="$CLASSPATH:$AJSC_HOME/extJars/"
63 CLASSPATH="$CLASSPATH:$AJSC_HOME/etc/"
65 # Check to see if the provided implementation exists in the image and add it to the classpath
66 for file in $( find ${BASEDIR}graph-deps/* -maxdepth 0 -type d ); do
67 CURRIMPL=$(echo $file | cut -d"/" -f6)
68 if [ "x$GRAPHIMPL" = "x$CURRIMPL" ]; then
69 CLASSPATH_GRAPHIMPL=$file
70 echo "Setting up graph implementation of $GRAPHIMPL"
72 SUPPORTED_GRAPHIMPL="$SUPPORTED_GRAPHIMPL $CURRIMPL"
75 if [ -n "$CLASSPATH_GRAPHIMPL" ]; then
76 cp $CLASSPATH_GRAPHIMPL/* $AJSC_HOME/extJars/
78 echo "Configured graph implementation '$GRAPHIMPL' is not supported. Acceptable implementations are one of: $SUPPORTED_GRAPHIMPL"
82 PROPS="-DAJSC_HOME=$AJSC_HOME"
83 PROPS="$PROPS -DAJSC_CONF_HOME=$BASEDIR/bundleconfig/"
84 PROPS="$PROPS -Dlogback.configurationFile=$BASEDIR/bundleconfig/etc/logback.xml"
85 PROPS="$PROPS -DAJSC_SHARED_CONFIG=$AJSC_CONF_HOME"
86 PROPS="$PROPS -DAJSC_SERVICE_NAMESPACE=champ-service"
87 PROPS="$PROPS -DAJSC_SERVICE_VERSION=v1"
88 PROPS="$PROPS -Dserver.port=9522"
89 PROPS="$PROPS -DCONFIG_HOME=$CONFIG_HOME"
90 JVM_MAX_HEAP=${MAX_HEAP:-1024}
94 exec java -Xmx${JVM_MAX_HEAP}m $PROPS -classpath $CLASSPATH com.att.ajsc.runner.Runner context=// sslport=9522