diff options
author | Yujun Zhang <zhang.yujunz@zte.com.cn> | 2017-08-28 01:54:13 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-28 01:54:13 +0000 |
commit | e8e46c97c8e3b7b77a598cd39e1f938e0bbef3c0 (patch) | |
tree | b4404e4bea46198c069dd43d0459359607de4072 /tests/ci/launch_containers_by_testsuite.sh | |
parent | 672dee17fb667d18036cf855458cd8a5f86e860a (diff) | |
parent | 73f6ca735e00902f9b71a9110eb97c7b008d8e94 (diff) |
Merge "Skip container and docker image clean up"
Diffstat (limited to 'tests/ci/launch_containers_by_testsuite.sh')
-rwxr-xr-x | tests/ci/launch_containers_by_testsuite.sh | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/ci/launch_containers_by_testsuite.sh b/tests/ci/launch_containers_by_testsuite.sh index c291a799..b55ba09c 100755 --- a/tests/ci/launch_containers_by_testsuite.sh +++ b/tests/ci/launch_containers_by_testsuite.sh @@ -29,18 +29,6 @@ if [[ "$TEST_SUITE" == 'compute' ]];then cat $ENV_FILE echo "--------------------------------------------------------" - if [[ ! -z $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG") ]]; then - echo "QTIP: Removing existing opnfv/qtip containers..." - container_id=$(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG" | awk '{print $1}') - docker stop $container_id - docker rm $container_id - fi - - if [[ $(docker images opnfv/qtip:${DOCKER_TAG} | wc -l) -gt 1 ]]; then - echo "QTIP: Removing docker image opnfv/qtip:$DOCKER_TAG..." - docker rmi opnfv/qtip:$DOCKER_TAG - fi - echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}" docker pull opnfv/qtip:$DOCKER_TAG >/dev/null @@ -49,7 +37,14 @@ if [[ "$TEST_SUITE" == 'compute' ]];then if [[ "$INSTALLER_TYPE" == "apex" ]];then vols="-v /root/.ssh:/root/.ssh" fi - cmd="sudo docker run -id ${envs} ${vols} opnfv/qtip:${DOCKER_TAG} /bin/bash" + container_name="qtip-${TEST_SUITE}" + if [[ -n $(docker ps -a|grep ${container_name}) ]]; then + echo "QTIP: cleaning existing container" + docker stop ${container_name} + docker rm ${container_name} + fi + + cmd="sudo docker run -id --name ${container_name} ${envs} ${vols} opnfv/qtip:${DOCKER_TAG} /bin/bash" echo "Qtip: Running docker command: ${cmd}" ${cmd} |