X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=jjb%2Fdovetail%2Fdovetail-cleanup.sh;h=3ae0cbcc94835b332a0f01ad0888e790108ab13d;hb=refs%2Fchanges%2F13%2F38413%2F7;hp=22b2ba2ce8427baf12084b599b9a53360e5e775f;hpb=79b920c07b40d64e70f93f28a0822ad1488f32ee;p=releng.git diff --git a/jjb/dovetail/dovetail-cleanup.sh b/jjb/dovetail/dovetail-cleanup.sh index 22b2ba2ce..3ae0cbcc9 100755 --- a/jjb/dovetail/dovetail-cleanup.sh +++ b/jjb/dovetail/dovetail-cleanup.sh @@ -1,9 +1,16 @@ #!/bin/bash +############################################################################## +# Copyright (c) 2017 Huawei Technologies Co.,Ltd and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null" -#clean up dependent project docker images, which has no containers and image tag None -clean_images=(opnfv/functest opnfv/yardstick) +# clean up dependent project docker images, which has no containers and image tag None +clean_images=(opnfv/functest opnfv/yardstick opnfv/testapi mongo) for clean_image in "${clean_images[@]}"; do echo "Removing image $image_id, which has no containers and image tag is None" dangling_images=($(docker images -f "dangling=true" | grep ${clean_image} | awk '{print $3}')) @@ -14,7 +21,7 @@ for clean_image in "${clean_images[@]}"; do fi done -echo "Remove containers with image dovetail:..." +echo "Remove containers with image opnfv/dovetail:..." dangling_images=($(docker images -f "dangling=true" | grep opnfv/dovetail | awk '{print $3}')) if [[ -n ${dangling_images} ]]; then for image_id in "${dangling_images[@]}"; do @@ -24,7 +31,7 @@ if [[ -n ${dangling_images} ]]; then done fi -echo "Cleaning up dovetail docker containers/images..." +echo "Cleaning up dovetail docker containers..." if [[ ! -z $(docker ps -a | grep opnfv/dovetail) ]]; then echo "Removing existing opnfv/dovetail containers..." docker ps -a | grep opnfv/dovetail | awk '{print $1}' | xargs docker rm -f >${redirect}