aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh
blob: 808b0b17ddf9ddf65f72f19c43881a867c2031a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

set -x

#Start DFC app

DOCKER_SIM_NWNAME="dfcnet"
echo "Creating docker network $DOCKER_SIM_NWNAME, if needed"
docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME

docker-compose up -d

DFC_APP="$(docker ps -q --filter='name=dfc_app0')"

#Wait for initialization of docker containers for dfc app and all simulators
for i in {1..10}; do
  if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ]
    then
      echo "DFC app Running"
      # enable TRACE logging of DFC
      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"

      #enable TRACE logging of spring-framework
      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"

      docker restart $DFC_APP
      sleep 10

      break
    else
      echo sleep $i
      sleep $i
  fi
done