Xiaohua Zhang | 2faa774 | 2019-04-12 08:47:03 +0000 | [diff] [blame] | 1 | #!/bin/sh |
Ethan Lynn | 2906f88 | 2018-01-15 10:32:43 +0800 | [diff] [blame] | 2 | # Copyright (c) 2017-2018 VMware, Inc. |
| 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. |
Bin Yang | b1b0386 | 2017-02-22 11:15:28 +0800 | [diff] [blame] | 15 | |
Bin Yang | 0a54204 | 2020-02-01 11:20:43 +0800 | [diff] [blame] | 16 | sed -i "s/MSB_SERVICE_PROTOCOL =.*/MSB_SERVICE_PROTOCOL = \"${MSB_PROTO}\"/g" multivimbroker/pub/config/config.py |
Ethan Lynn | c763387 | 2017-08-28 16:45:26 +0800 | [diff] [blame] | 17 | sed -i "s/MSB_SERVICE_IP =.*/MSB_SERVICE_IP = \"${MSB_ADDR}\"/g" multivimbroker/pub/config/config.py |
| 18 | sed -i "s/MSB_SERVICE_PORT =.*/MSB_SERVICE_PORT = \"${MSB_PORT}\"/g" multivimbroker/pub/config/config.py |
| 19 | sed -i "s/AAI_ADDR =.*/AAI_ADDR = \"${AAI_ADDR}\"/g" multivimbroker/pub/config/config.py |
| 20 | sed -i "s/AAI_PORT =.*/AAI_PORT = \"${AAI_PORT}\"/g" multivimbroker/pub/config/config.py |
| 21 | sed -i "s/AAI_SCHEMA_VERSION =.*/AAI_SCHEMA_VERSION = \"${AAI_SCHEMA_VERSION}\"/g" multivimbroker/pub/config/config.py |
| 22 | sed -i "s/AAI_USERNAME =.*/AAI_USERNAME = \"${AAI_USERNAME}\"/g" multivimbroker/pub/config/config.py |
| 23 | sed -i "s/AAI_PASSWORD =.*/AAI_PASSWORD = \"${AAI_PASSWORD}\"/g" multivimbroker/pub/config/config.py |
Andreas Geissler | aa75c52 | 2022-11-08 10:01:54 +0100 | [diff] [blame] | 24 | sed -i "s/AAI_PROTOCOL =.*/AAI_PROTOCOL = \"${AAI_PROTOCOL}\"/g" multivimbroker/pub/config/config.py |
Ethan Lynn | c763387 | 2017-08-28 16:45:26 +0800 | [diff] [blame] | 25 | |
liangke | d346df7 | 2018-03-05 17:04:16 +0800 | [diff] [blame] | 26 | logDir="/var/log/onap/multicloud/multivimbroker" |
| 27 | if [ ! -x $logDir ]; then |
| 28 | mkdir -p $logDir |
| 29 | fi |
| 30 | |
Hong Hui Xiao | d7297be | 2018-03-12 17:59:05 +0800 | [diff] [blame] | 31 | if [ "$WEB_FRAMEWORK" == "pecan" ] |
| 32 | then |
| 33 | python multivimbroker/scripts/api.py |
| 34 | else |
Yun Huang | 38e7e69 | 2018-03-24 00:28:34 +0800 | [diff] [blame] | 35 | # nohup python manage.py runserver 0.0.0.0:9001 2>&1 & |
Xiaohua Zhang | 2faa774 | 2019-04-12 08:47:03 +0000 | [diff] [blame] | 36 | if [ "${SSL_ENABLED}" = "true" ]; then |
Xiaohua Zhang | 771d3a4 | 2019-03-11 08:38:37 +0000 | [diff] [blame] | 37 | nohup uwsgi --https :9001,multivimbroker/pub/ssl/cert/cert.crt,multivimbroker/pub/ssl/cert/cert.key,HIGH -t 120 --module multivimbroker.wsgi --master --processes 4 & |
Xiaohua Zhang | 9d53698 | 2019-03-08 06:08:47 +0000 | [diff] [blame] | 38 | else |
| 39 | nohup uwsgi --http :9001 -t 120 --module multivimbroker.wsgi --master --processes 4 & |
| 40 | fi |
Ethan Lynn | c763387 | 2017-08-28 16:45:26 +0800 | [diff] [blame] | 41 | |
Hong Hui Xiao | d7297be | 2018-03-12 17:59:05 +0800 | [diff] [blame] | 42 | while [ ! -f $logDir/multivimbroker.log ]; do |
| 43 | sleep 1 |
| 44 | done |
Ethan Lynn | c763387 | 2017-08-28 16:45:26 +0800 | [diff] [blame] | 45 | |
Hong Hui Xiao | d7297be | 2018-03-12 17:59:05 +0800 | [diff] [blame] | 46 | tail -F $logDir/multivimbroker.log |
Bin Yang | 4f42374 | 2019-03-04 04:30:40 +0000 | [diff] [blame] | 47 | fi |