]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Fix CI errors caused by container status commands 531/head
authorIvan Font <ifont@redhat.com>
Wed, 2 Nov 2016 03:44:36 +0000 (20:44 -0700)
committerIvan Font <ifont@redhat.com>
Wed, 2 Nov 2016 18:06:29 +0000 (11:06 -0700)
The docker ps command was returning no containers that caused the docker
rm command to fail. That, combined with the set -e flag was causing the
build script to exit prematurely.

Signed-off-by: Ivan Font <ifont@redhat.com>
ceph-docker-pull-requests/build/build

index c430af41ffc19325e7ffe9776ac6875ffca14fb6..02a2b9dec24bcf6994054a962e0466138a808f7a 100644 (file)
@@ -17,7 +17,12 @@ sudo apt-get install -y --force-yes xfsprogs
 sudo "$WORKSPACE"/ceph-docker/travis-builds/purge_cluster.sh
 # XXX purge_cluster only stops containers, it doesn't really remove them so try to
 # remove them for real
-sudo docker rm -f $@ $(sudo docker ps -a -q)
+containers_to_remove=$(sudo docker ps -a -q)
+
+if [ "${containers_to_remove}" ]; then
+    sudo docker rm -f $@ ${containers_to_remove} || echo failed to remove containers
+fi
+
 
 sudo "$WORKSPACE"/ceph-docker/travis-builds/build_imgs.sh