qtip bugfix: failed to clean up qtip container 91/20991/4
authorwu.zhihui <wu.zhihui1@zte.com.cn>
Tue, 13 Sep 2016 08:44:04 +0000 (16:44 +0800)
committerwu.zhihui <wu.zhihui1@zte.com.cn>
Sun, 18 Sep 2016 07:03:35 +0000 (15:03 +0800)
An error has happened a few times when stopping a container.
See
https://build.opnfv.org/ci/view/qtip/job/qtip-fuel-zte-pod2-daily-master/34/console.
Don't find the cause of this error temporarily.
Use the command "docker rm -f" to remove qtip container by force.
It is a workaround to make sure qtip ci job not blocked by this error.

According to ci log, sometimes, qtip containers are deleted failed.
This change use the command "docker rm -f" to delete containers
by force.

Change-Id: I063be9615f1b87e616ff8c3a77a6684a68474e91
Signed-off-by: wu.zhihui <wu.zhihui1@zte.com.cn>
jjb/qtip/qtip-cleanup.sh

index b923aa2..95babb3 100644 (file)
@@ -6,15 +6,12 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-echo "Cleaning up QTIP  docker containers/images..."
-
 # Remove previous running containers if exist
 if [[ ! -z $(docker ps -a | grep opnfv/qtip) ]]; then
     echo "Removing existing opnfv/qtip containers..."
-    running_containers=$(docker ps | grep opnfv/qtip | awk '{print $1}')
-    docker stop ${running_containers}
-    all_containers=$(docker ps -a | grep opnfv/qtip | awk '{print $1}')
-    docker rm ${all_containers}
+    # workaround: sometimes it throws an error when stopping qtip container.
+    # To make sure ci job unblocked, remove qtip container by force without stopping it.
+    docker rm -f $(docker ps -a | grep opnfv/qtip | awk '{print $1}')
 fi
 
 # Remove existing images if exist
@@ -27,4 +24,3 @@ if [[ ! -z $(docker images | grep opnfv/qtip) ]]; then
         docker rmi opnfv/qtip:$tag
     done
 fi
-