From b1ee51cf44ab63dbfaf21834c90c8fb8adb0eb4e Mon Sep 17 00:00:00 2001 From: Ryota MIBU Date: Wed, 7 Dec 2016 19:28:07 +0000 Subject: [PATCH] functest,doctor: CLEAN_DOCKER_IMAGES The builder/script 'functest-cleanup' will delete docker images for functest, so that we can make sure the latest functest will be used during the tests. But, it also makes a pod downloads image every time CI triggered functest-suite. This patch adds option 'CLEAN_DOCKER_IMAGES' (default=true), so that the job owner can choose whether he/she wants to drop the docker images or not depends on frequency or charactaristics of the job. Change-Id: I0b7affccb404fb8c4f0939b00d65e363ec62f7c3 Signed-off-by: Ryota MIBU --- jjb/doctor/doctor.yml | 4 ++++ jjb/functest/functest-ci-jobs.yml | 4 ++++ jjb/functest/functest-cleanup.sh | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/jjb/doctor/doctor.yml b/jjb/doctor/doctor.yml index 7a5bd22f2..8a0d0155a 100644 --- a/jjb/doctor/doctor.yml +++ b/jjb/doctor/doctor.yml @@ -95,6 +95,10 @@ name: DOCKER_TAG default: '{docker-tag}' description: 'Tag to pull docker image' + - string: + name: CLEAN_DOCKER_IMAGES + default: 'false' + description: 'Remove downloaded docker images (opnfv/functest:*)' - string: name: DEPLOY_SCENARIO default: 'os-nosdn-nofeature-ha' diff --git a/jjb/functest/functest-ci-jobs.yml b/jjb/functest/functest-ci-jobs.yml index 1cded61fc..915828ca7 100644 --- a/jjb/functest/functest-ci-jobs.yml +++ b/jjb/functest/functest-ci-jobs.yml @@ -224,6 +224,10 @@ name: DOCKER_TAG default: '{docker-tag}' description: 'Tag to pull docker image' + - string: + name: CLEAN_DOCKER_IMAGES + default: 'true' + description: 'Remove downloaded docker images (opnfv/functest:*)' - functest-parameter: gs-pathname: '{gs-pathname}' diff --git a/jjb/functest/functest-cleanup.sh b/jjb/functest/functest-cleanup.sh index 4bedfe7de..3c4c7f965 100755 --- a/jjb/functest/functest-cleanup.sh +++ b/jjb/functest/functest-cleanup.sh @@ -10,7 +10,7 @@ if [[ ! -z $(docker ps -a | grep opnfv/functest) ]]; then fi # Remove existing images if exist -if [[ ! -z $(docker images | grep opnfv/functest) ]]; then +if [[ $CLEAN_DOCKER_IMAGES ]] && [[ ! -z $(docker images | grep opnfv/functest) ]]; then echo "Docker images to remove:" docker images | head -1 && docker images | grep opnfv/functest >${redirect} image_tags=($(docker images | grep opnfv/functest | awk '{print $2}')) -- 2.16.6