BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame^] | 3 | set -x |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 4 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame^] | 5 | #Start DFC app |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 6 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame^] | 7 | DOCKER_SIM_NWNAME="dfcnet" |
| 8 | echo "Creating docker network $DOCKER_SIM_NWNAME, if needed" |
| 9 | docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME |
| 10 | |
| 11 | docker-compose up -d |
| 12 | |
| 13 | DFC_APP="$(docker ps -q --filter='name=dfc_app0')" |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 14 | |
| 15 | #Wait for initialization of docker containers for dfc app and all simulators |
| 16 | for i in {1..10}; do |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame^] | 17 | if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ] |
| 18 | then |
| 19 | echo "DFC app Running" |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 20 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame^] | 21 | # enable TRACE logging of DFC |
| 22 | docker exec $DFC_APP /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml" |
| 23 | |
| 24 | #enable TRACE logging of spring-framework |
| 25 | docker exec $DFC_APP /bin/sh -c " sed -i 's/org.springframework.data: ERROR/org.springframework.data: TRACE/g' /opt/app/datafile/config/application.yaml" |
| 26 | |
| 27 | docker restart $DFC_APP |
| 28 | sleep 10 |
| 29 | |
| 30 | break |
| 31 | else |
| 32 | echo sleep $i |
| 33 | sleep $i |
| 34 | fi |
| 35 | done |