aboutsummaryrefslogtreecommitdiffstats
path: root/plans/dcaegen2-collectors-datafile/Functional-suite/teardown.sh
blob: eaebbc24f44eef6f7972bf5ea0fed2d95559c242 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env bash

running_containers=$(docker ps --filter name=dfc_ -qa)
running_images=$(docker images -q)
docker exec -it dfc_app0 cat /var/log/ONAP/application.log >> $WORKSPACE/archives/dfc_app0_application.log
docker logs dfc_mr-sim >> $WORKSPACE/archives/dfc_mr-sim.log

if [ -z "$running_containers" ]
then
    echo "No container requires termination"
else
    echo "Stopping and removing containers"
    docker stop $running_containers
    docker rm $running_containers
    docker rmi $running_images
fi