Fix error caused by empty env TOPOURL
[sdnc/oam.git] / installation / sdnc-web / src / main / scripts / run.sh
1 #!/bin/bash
2
3 ###
4 #============LICENSE_START=======================================================
5 # ONAP : ccsdk distribution web
6 #================================================================================
7 # Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
8 # All rights reserved.
9 #================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
13 #
14 #      http://www.apache.org/licenses/LICENSE-2.0
15 #
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 #============LICENSE_END=========================================================
22 ###
23  
24 /opt/bitnami/nginx/sbin/configure.sh
25
26 echo "starting sdnc-web"
27 echo "================="
28 echo " WEBPROTOCOL  : $WEBPROTOCOL"
29 echo " WEBPORT      : $WEBPORT"
30 echo " SDNRPROTOCOL : $SDNRPROTOCOL"
31 echo " SDNRHOST     : $SDNRHOST"
32 echo " SDNRPORT     : $SDNRPORT"
33 echo " DNS_RESOLVER : $DNS_RESOLVER"
34 echo " TRPCEURL     : $TRPCEURL"
35 echo " TOPOURL      : $TOPOURL"
36 echo " TILEURL      : $TILEURL"
37 if [ "$WEBPROTOCOL" == "HTTPS" ]; then
38   echo " SSL_CERT_DIR : $SSL_CERT_DIR"
39   echo -n " SSL_CERTIFICATE: $SSL_CERTIFICATE"
40   if [ -f "$SSL_CERT_DIR/$SSL_CERTIFICATE" ]; then
41     echo " (exists)"
42   else
43     echo " (missing)"
44   fi
45   echo -n " SSL_CERTIFICATE_KEY: $SSL_CERTIFICATE_KEY"
46   if [ -f "$SSL_CERT_DIR/$SSL_CERTIFICATE_KEY" ]; then
47     echo " (exists)"
48   else
49     echo " (missing)"
50   fi
51 fi
52 echo ""
53
54 if [ ! -z "$DEBUG" ]; then
55
56   if [ -f "/opt/bitnami/nginx/conf/server_blocks/http_site.conf" ]; then
57     echo "content of /opt/bitnami/nginx/conf/server_blocks/http_site.conf"
58     echo "==============================================================="
59     cat /opt/bitnami/nginx/conf/server_blocks/http_site.conf
60     echo "==============================================================="
61   fi
62
63   if [ -f "/opt/bitnami/nginx/conf/server_blocks/https_site.conf" ]; then
64     echo "content of /opt/bitnami/nginx/conf/server_blocks/https_site.conf"
65     echo "==============================================================="
66     cat /opt/bitnami/nginx/conf/server_blocks/https_site.conf
67     echo "==============================================================="
68   fi
69
70   #tail -f /opt/bitnami/nginx/logs/* &
71 fi
72
73 # Call the base images' run.sh to start NGINX
74 bash /run.sh