aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYujun Zhang <zhang.yujunz@zte.com.cn>2017-08-24 18:57:51 +0800
committerYujun Zhang <zhang.yujunz@zte.com.cn>2017-08-26 10:23:01 +0800
commit73f6ca735e00902f9b71a9110eb97c7b008d8e94 (patch)
treed6681affcb22dcb30351592de5b89ccfe58c49c6
parent4bc87f5dc55cfbcc1cc7cdcbd1b6414d0da1e987 (diff)
Skip container and docker image clean up
- This helps to use the cache on CI pod and reduce build time. - Dangling containers and docker images will be cleaned up in a separate periodic job. Change-Id: Ifa756714698c71b8dde0cbe089661936e94e8a17 Signed-off-by: Yujun Zhang <zhang.yujunz@zte.com.cn>
-rwxr-xr-xtests/ci/launch_containers_by_testsuite.sh21
-rwxr-xr-xtests/ci/storperf/containers.sh14
2 files changed, 8 insertions, 27 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}
diff --git a/tests/ci/storperf/containers.sh b/tests/ci/storperf/containers.sh
index 02a947da..26d582bf 100755
--- a/tests/ci/storperf/containers.sh
+++ b/tests/ci/storperf/containers.sh
@@ -11,20 +11,6 @@ clean_containers()
{
echo "QTIP: Cleanup existing qtip and storperf containers"
docker-compose -f qtip-storperf-docker-compose.yaml down
-
- for name in qtip storperf-master storperf-swaggerui storperf-httpfrontend storperf-reporting
- do
- container=$(docker ps -a | grep "opnfv/${name}:${DOCKER_TAG}" | awk '{print $1}')
- if [[ ! -z "$container" ]]; then
- echo "QTIP: Removing any existing $name container"
- docker rm -v $container
- fi
-
- if [[ $(docker images opnfv/${name}:${DOCKER_TAG} | wc -l) -gt 1 ]]; then
- echo "QTIP: Removing docker image opnfv/$name :$DOCKER_TAG..."
- docker rmi opnfv/${name}:${DOCKER_TAG}
- fi
- done
}