3 # ============LICENSE_START=======================================================
5 # ================================================================================
6 # Copyright (C) 2017 AT&T Intellectual Property. All rights
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 # ===================================================================
22 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
25 echo "This is ${WORKSPACE}/scripts/vvp/start_vvp_containers.sh"
28 export PREFIX='nexus3.onap.org:10001/openecomp/vvp'
29 export RELEASE='latest'
31 #start Engagement Manager pod:
35 --name vvp-engagementmgr \
36 --env-file ${WORKSPACE}/data/environments/vvp_env.list \
37 --log-driver=json-file \
38 --log-opt max-size=100m \
39 --log-opt max-file=10 \
40 --ulimit memlock=-1:-1 \
43 --ulimit nofile=4096:100000 \
44 --volume /etc/localtime:/etc/localtime:ro \
45 --volume /opt/configmaps/settings:/opt/configmaps/settings/ \
46 --publish 9090:80 ${PREFIX}/engagementmgr:${RELEASE}
48 docker cp /opt/configmaps/settings/uwsgi.ini vvp-engagementmgr:/srv/vvp/settings/
50 echo "please wait while Engagement Manager is starting..."
52 c=60 # seconds to wait
53 REWRITE="\e[25D\e[1A\e[K"
54 while [ $c -gt 0 ]; do
57 echo -e "${REWRITE}$c"
62 docker exec -d vvp-engagementmgr sh -c "python3 /srv/manage.py migrate"
64 #run initial populate db again:
65 docker exec -d vvp-engagementmgr sh -c "python3 /srv/manage.py initial_populate_db"
68 echo "Will copy the generated DB sqlite3 file into the application directory in 30 seconds..."
70 #copy the generated DB sqlite3 file into the application directory:
71 docker exec -d vvp-engagementmgr sh -c "cp emdb.db /srv/emdb.db -f"
76 while [ "$TIME" -lt "$TIME_OUT" ]; do
77 response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:9090/vvp/v1/engmgr/vendors); echo $response
79 if [ "$response" == "200" ]; then
80 echo VVP-Engagement-Manager well started in $TIME seconds
84 echo Sleep: $INTERVAL seconds before testing if VVP-Engagement-Manager is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
86 TIME=$(($TIME+$INTERVAL))
89 if [ "$TIME" -ge "$TIME_OUT" ]; then
90 echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests...
92 echo "Done starting vvp containers!"