From 778d33db56142ad0301da9e253822d1883166bb4 Mon Sep 17 00:00:00 2001 From: MatthewLi Date: Thu, 18 May 2017 02:45:11 -0400 Subject: dovetail: offline support by making users to download docker images from artifacts JIRA: DOVETAIL-433 1) bugfix of cleanup by using existed dovetail cleanup scripts, see logs https://build.opnfv.org/ci/view/dovetail/job/dovetail-functest-artifacts-upload-master/3/console 2) opnfv/testapi:latest and mongo:3.5 images are needed for dovetail, added. Change-Id: I647f7152b0122a5b792f6f18efbae0e537b81332 Signed-off-by: MatthewLi --- jjb/dovetail/dovetail-artifacts-upload.yml | 36 +++++++++--------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'jjb/dovetail/dovetail-artifacts-upload.yml') diff --git a/jjb/dovetail/dovetail-artifacts-upload.yml b/jjb/dovetail/dovetail-artifacts-upload.yml index 3d9af5ed7..0c8efbe0d 100644 --- a/jjb/dovetail/dovetail-artifacts-upload.yml +++ b/jjb/dovetail/dovetail-artifacts-upload.yml @@ -19,6 +19,8 @@ - 'dovetail' - 'functest' - 'yardstick' + - 'testapi' + - 'mongo' ############################################# # job template @@ -55,7 +57,8 @@ builders: - 'dovetail-builder-artifacts-upload' - - 'dovetail-workspace-cleanup' + - 'dovetail-upload-artifacts-cache-cleanup' + - 'dovetail-images-cleanup' #################### # parameter macros @@ -94,7 +97,7 @@ !include-raw: ./dovetail-artifacts-upload.sh - builder: - name: dovetail-workspace-cleanup + name: dovetail-upload-artifacts-cache-cleanup builders: - shell: | #!/bin/bash @@ -104,27 +107,8 @@ /bin/rm -rf $CACHE_DIR - # Remove previous running containers if exist - if [[ -n "$(docker ps -a | grep $DOCKER_REPO_NAME)" ]]; then - echo "Removing existing $DOCKER_REPO_NAME containers..." - docker ps -a | grep $DOCKER_REPO_NAME | awk '{print $1}' | xargs docker rm -f - t=60 - # Wait max 60 sec for containers to be removed - while [[ $t -gt 0 ]] && [[ -n "$(docker ps| grep $DOCKER_REPO_NAME)" ]]; do - sleep 1 - let t=t-1 - done - fi - - # Remove existing images if exist - if [[ -n "$(docker images | grep $DOCKER_REPO_NAME)" ]]; then - echo "Docker images to remove:" - docker images | head -1 && docker images | grep $DOCKER_REPO_NAME - image_tags=($(docker images | grep $DOCKER_REPO_NAME | awk '{print $2}')) - for tag in "${image_tags[@]}"; do - if [[ -n "$(docker images|grep $DOCKER_REPO_NAME|grep $tag)" ]]; then - echo "Removing docker image $DOCKER_REPO_NAME:$tag..." - docker rmi -f $DOCKER_REPO_NAME:$tag - fi - done - fi +- builder: + name: dovetail-images-cleanup + builders: + - shell: + !include-raw: ./dovetail-cleanup.sh -- cgit 1.2.3-korg