BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
yanhuanwang | 4805f96 | 2019-09-11 20:44:10 +0200 | [diff] [blame] | 3 | running_containers=$(docker ps --filter name=dfc_ -qa) |
| 4 | running_images=$(docker images -q) |
yanhuanwang | f38c5ac | 2019-09-17 18:02:14 +0200 | [diff] [blame] | 5 | docker exec dfc_app0 cat /var/log/ONAP/application.log >> $WORKSPACE/archives/dfc_app0_application.log |
yanhuanwang | 459a620 | 2019-09-13 14:19:05 +0200 | [diff] [blame] | 6 | docker logs dfc_mr-sim >> $WORKSPACE/archives/dfc_mr-sim.log |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 7 | |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 8 | if [ -z "$running_containers" ] |
| 9 | then |
| 10 | echo "No container requires termination" |
| 11 | else |
| 12 | echo "Stopping and removing containers" |
| 13 | docker stop $running_containers |
| 14 | docker rm $running_containers |
yanhuanwang | 4805f96 | 2019-09-11 20:44:10 +0200 | [diff] [blame] | 15 | docker rmi $running_images |
TamasBakai | e81736c | 2019-08-23 13:31:57 +0000 | [diff] [blame] | 16 | fi |
BjornMagnussonXA | d3104ef | 2019-03-26 12:48:46 +0000 | [diff] [blame] | 17 | |