3 # ============LICENSE_START==========================================
5 # ===================================================================
6 # Copyright © 2019 AT&T Intellectual Property. All rights reserved.
7 # ===================================================================
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
12 # http://www.apache.org/licenses/LICENSE-2.0
14 # Unless required by applicable law or agreed to in writing, software
15 # distributed under the License is distributed on an "AS IS" BASIS,
16 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 # See the License for the specific language governing permissions and
18 # limitations under the License.
19 # ============LICENSE_END============================================
20 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
27 APP_ROOT=/opt/app/$COMPONENT
30 PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
32 CONFIGMAP_ROOT=${CONFIGMAP_ROOT:-/opt/app/config}
33 CONTAINER_CONFIG=$CONFIGMAP_ROOT/conf/dbc-client.env
43 echo "Expected app root directory $APP_ROOT does not exist"
47 find . -type f -exec ls -l {} \;
48 find $CONFIGMAP_ROOT -type f -exec ls -l {} \;
49 if [ ! -f $CONTAINER_CONFIG ]
51 echo "WARNING: Expected env file $CONTAINER_CONFIG not found. Default behaviors in effect"
53 source $CONTAINER_CONFIG
56 if [ "$DMAAPBC_WAIT_TO_EXIT" != "Y" ]
58 echo "Creating $APP_ROOT/ok_to_exit so no waiting..."
59 > $APP_ROOT/ok_to_exit
61 echo "Not creating $APP_ROOT/ok_to_exit"
64 if [ ! -f $APP_ROOT/misc/cert-client-init.sh ]
66 echo "Did not find $APP_ROOT/misc/cert-client-init.sh to append to truststore"
69 $APP_ROOT/misc/cert-client-init.sh
77 if [ ! -d $CONFIGMAP_ROOT ]
79 echo $CONFIGMAP_ROOT does not exist
83 #loop on get /dmaap until we get a good response to indicate other provisioning can continue
85 while [ $rc != "200" ]
88 rc=`curl -s -o /dev/null -I -w "%{http_code}" -X GET -H "Content-Type: application/json" http://dmaap-bc:8080/webapi/dmaap`
89 echo "get dmaap response=${rc}"
96 # order is important in this next list
97 for uri in dmaap dcaeLocations mr_clusters topics feeds mr_clients dr_pubs dr_subs
101 for j in `ls ${uri}/*.json`
103 echo "POST $j to $uri"
104 rc=`curl -v -X POST -w "%{http_code}" -H "Content-Type: application/json" -d @${j} http://dmaap-bc:8080/webapi/${uri}`
116 echo "Check $APP_ROOT/ok_to_exit"
117 while [ ! -f $APP_ROOT/ok_to_exit ]
119 echo "$APP_ROOT/ok_to_exit does not exist. Sticking around for debugging..."