aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/Prox_BM_ACL-4Port-1507803770817.json
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-03-20 13:24:11 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-20 13:24:11 +0000
commit5f61719a12ff20df3679d01578de84110f68302f (patch)
tree24a02211d648634ec7d74b159420151ed4e8ef8a /dashboard/Prox_BM_ACL-4Port-1507803770817.json
parent1e978661eadeeb6aa868d1ad4cbba8236bf8162f (diff)
parent291030e89e87b4c3c0af0e53a5a3b00b212abd32 (diff)
Merge "update scenario test cases according to gating release"
Diffstat (limited to 'dashboard/Prox_BM_ACL-4Port-1507803770817.json')
0 files changed, 0 insertions, 0 deletions
Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/bin/bash

[[ $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)
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}'))
    if [[ -n ${dangling_images} ]]; then
        for image_id in "${dangling_images[@]}"; do
            docker rmi $image_id >${redirect}
        done
    fi
done

echo "Remove containers with image dovetail:<None>..."
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
        echo "Removing image $image_id with tag None and its related containers"
        docker ps -a | grep $image_id | awk '{print $1}'| xargs docker rm -f >${redirect}
        docker rmi $image_id >${redirect}
    done
fi

echo "Cleaning up dovetail docker containers/images..."
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}
fi

echo "Remove dovetail existing images if exist..."
if [[ ! -z $(docker images | grep opnfv/dovetail) ]]; then
    echo "Docker images to remove:"
    docker images | head -1 && docker images | grep opnfv/dovetail >${redirect}
    image_tags=($(docker images | grep opnfv/dovetail | awk '{print $2}'))
    for tag in "${image_tags[@]}"; do
        echo "Removing docker image opnfv/dovetail:$tag..."
        docker rmi opnfv/dovetail:$tag >${redirect}
    done
fi