Merge "qtip bugfix: failed to clean up qtip container"
authorMorgan Richomme <morgan.richomme@orange.com>
Tue, 27 Sep 2016 07:02:24 +0000 (07:02 +0000)
committerGerrit Code Review <gerrit@172.30.200.206>
Tue, 27 Sep 2016 07:02:24 +0000 (07:02 +0000)
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
-