From 46a61e84fa16374a0973f57a78c6e512a048e15d Mon Sep 17 00:00:00 2001 From: Cristina Pauna Date: Thu, 12 Jul 2018 11:52:50 +0300 Subject: Ensure docker prunning can be done Sometimes the docker build fails and the docker process hangs on a container, withouth being able to stop it. This causes spurious failures on other builds that shouldn't fail. The prune job should cleanup the hanging containers and images, but it fails when the docker process is hanged. This change adds a docker restart to the prune job, in order to assure that the hanged container is shut down and can be removed. JIRA: ARMBAND-358 Change-Id: I9d04fa1099a6fc53bf773a2eba33be89db7d0aa1 Signed-off-by: Cristina Pauna --- jjb/releng/opnfv-utils.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/jjb/releng/opnfv-utils.yaml b/jjb/releng/opnfv-utils.yaml index 19fb4b5af..1d50eb44e 100644 --- a/jjb/releng/opnfv-utils.yaml +++ b/jjb/releng/opnfv-utils.yaml @@ -41,6 +41,7 @@ # yamllint disable rule:line-length - shell: | #!/bin/bash + sudo systemctl restart docker (docker ps -q; docker ps -aq) | sort | uniq -u | xargs --no-run-if-empty docker rm docker images -f dangling=true -q | xargs --no-run-if-empty docker rmi -- cgit 1.2.3-korg