Ensure docker prunning can be done 35/59735/1
authorCristina Pauna <cristina.pauna@enea.com>
Thu, 12 Jul 2018 08:52:50 +0000 (11:52 +0300)
committerCristina Pauna <cristina.pauna@enea.com>
Thu, 12 Jul 2018 08:57:40 +0000 (11:57 +0300)
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 <cristina.pauna@enea.com>
jjb/releng/opnfv-utils.yaml

index 19fb4b5..1d50eb4 100644 (file)
@@ -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