From: Yujun Zhang Date: Wed, 16 Aug 2017 07:51:15 +0000 (+0800) Subject: [qtip] refactoring ci scripts X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=ca02d5fda706a7e10f5f23536da0ceae79d42e2e;p=releng.git [qtip] refactoring ci scripts - manage help scripts in qtip repo instead of releng - call entry script in qtip from releng JIRA: QTIP-268 Change-Id: Ibd0d2c2533c1a7f1963f6c3214c563499cce8b22 Signed-off-by: Yujun Zhang --- diff --git a/jjb/qtip/helpers/cleanup-deploy.sh b/jjb/qtip/helpers/cleanup-deploy.sh deleted file mode 100644 index 9cb19a583..000000000 --- a/jjb/qtip/helpers/cleanup-deploy.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2016 ZTE and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -# Remove previous running containers if exist -if [[ ! -z $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG") ]]; then - echo "Removing existing opnfv/qtip containers..." - # workaround: sometimes it throws an error when stopping qtip container. - # To make sure ci job unblocked, remove qtip container by force without stopping it. - docker rm -f $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG" | awk '{print $1}') -fi - -# Remove existing images if exist -if [[ $(docker images opnfv/qtip:${DOCKER_TAG} | wc -l) -gt 1 ]]; then - echo "Removing docker image opnfv/qtip:$DOCKER_TAG..." - docker rmi opnfv/qtip:$DOCKER_TAG -fi diff --git a/jjb/qtip/helpers/validate-deploy.sh b/jjb/qtip/helpers/validate-deploy.sh deleted file mode 100644 index af8f8c200..000000000 --- a/jjb/qtip/helpers/validate-deploy.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -############################################################################## -# Copyright (c) 2017 ZTE and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## -set -e - -echo "--------------------------------------------------------" -echo "POD: $NODE_NAME" -echo "Scenario: $DEPLOY_SCENARIO" -echo "INSTALLER: $INSTALLER_TYPE" -echo "INSTALLER_IP: $INSTALLER_IP" -echo "--------------------------------------------------------" - -echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}" -docker pull opnfv/qtip:$DOCKER_TAG >/dev/null - -envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} --e POD_NAME=${NODE_NAME} -e SCENARIO=${DEPLOY_SCENARIO}" - -cmd=" docker run -id -e $envs opnfv/qtip:${DOCKER_TAG} /bin/bash" -echo "Qtip: Running docker command: ${cmd}" -${cmd} - -container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1) -if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then - echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..." - exit 1 -fi - -echo "The container ID is: ${container_id}" -QTIP_REPO=/home/opnfv/repos/qtip - -docker exec -t ${container_id} bash -c "bash ${QTIP_REPO}/tests/ci/run_ci.sh" - -echo "Qtip done!" -exit 0 \ No newline at end of file diff --git a/jjb/qtip/helpers/validate-setup.sh b/jjb/qtip/helpers/validate-setup.sh deleted file mode 100644 index 8d84e120c..000000000 --- a/jjb/qtip/helpers/validate-setup.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -############################################################################## -# Copyright (c) 2017 ZTE and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - -set -e - -# setup virtualenv -sudo pip install -u virtualenv virtualenvwrapper -export WORKON_HOME=$HOME/.virtualenvs -source /usr/local/bin/virtualenvwrapper.sh -mkvirtualenv qtip -workon qtip - -# setup qtip -sudo pip install $HOME/repos/qtip - -# testing -qtip --version -qtip --help diff --git a/jjb/qtip/qtip-integration-jobs.yml b/jjb/qtip/qtip-experimental-jobs.yml similarity index 69% rename from jjb/qtip/qtip-integration-jobs.yml rename to jjb/qtip/qtip-experimental-jobs.yml index 4382dff3e..05445d898 100644 --- a/jjb/qtip/qtip-integration-jobs.yml +++ b/jjb/qtip/qtip-experimental-jobs.yml @@ -1,12 +1,12 @@ -###################### -# verify before MERGE -###################### +########################################### +# Experimental jobs for development purpose +########################################### - project: - name: qtip-integration-jobs + name: qtip-experimental-jobs project: qtip jobs: - - 'qtip-storage-{stream}' + - 'qtip-experimental-{stream}' stream: - master: branch: '{stream}' @@ -18,7 +18,7 @@ ################################# - job-template: - name: 'qtip-storage-{stream}' + name: 'qtip-experimental-{stream}' disabled: '{obj:disabled}' @@ -41,8 +41,4 @@ builders: - shell: | #!/bin/bash - set -o errexit - set -o pipefail - set -o xtrace - - source integration/storperf/run_ci.sh + source tests/ci/experimental.sh diff --git a/jjb/qtip/qtip-validate-jobs.yml b/jjb/qtip/qtip-validate-jobs.yml index 73d7993c9..e64173ca7 100644 --- a/jjb/qtip/qtip-validate-jobs.yml +++ b/jjb/qtip/qtip-validate-jobs.yml @@ -17,27 +17,27 @@ #-------------------------------- # JOB VARIABLES #-------------------------------- - pod: - - zte-pod1: - installer: fuel - scenario: os-odl_l2-nofeature-ha + qpi: + - compute: + installer: apex + pod: zte-pod4 <<: *master - - zte-pod3: - installer: fuel - scenario: os-nosdn-kvm-ha + - storage: + installer: apex + pod: zte-pod4 <<: *master #-------------------------------- # JOB LIST #-------------------------------- jobs: - - 'qtip-{scenario}-{pod}-daily-{stream}' + - 'qtip-{qpi}-{installer}-{stream}' ################################ # job templates ################################ - job-template: - name: 'qtip-{scenario}-{pod}-daily-{stream}' + name: 'qtip-{qpi}-{installer}-{stream}' disabled: false parameters: - project-parameter: @@ -47,7 +47,7 @@ - '{pod}-defaults' - string: name: DEPLOY_SCENARIO - default: '{scenario}' + default: generic - string: name: DOCKER_TAG default: '{docker-tag}' @@ -56,14 +56,19 @@ name: CI_DEBUG default: 'false' description: "Show debug output information" + - string: + name: TEST_SUITE + default: '{qpi}' scm: - git-scm triggers: - - 'qtip-{scenario}-{pod}-daily-{stream}-trigger' + - 'qtip-daily' builders: - description-setter: description: "POD: $NODE_NAME" - - qtip-validate-deploy + - shell: | + #!/bin/bash + source tests/ci/periodic.sh publishers: - qtip-common-publishers - email-jenkins-admins-on-failure @@ -75,14 +80,6 @@ #--------- # builder #--------- -- builder: - name: qtip-validate-deploy - builders: - - shell: - !include-raw: ./helpers/cleanup-deploy.sh - - shell: - !include-raw: ./helpers/validate-deploy.sh - #----------- # parameter @@ -103,11 +100,6 @@ #--------- - trigger: - name: 'qtip-os-odl_l2-nofeature-ha-zte-pod1-daily-master-trigger' - triggers: - - timed: '0 15 * * *' - -- trigger: - name: 'qtip-os-nosdn-kvm-ha-zte-pod3-daily-master-trigger' + name: 'qtip-daily' triggers: - timed: '0 15 * * *' diff --git a/jjb/qtip/qtip-weekly-jobs.yml b/jjb/qtip/qtip-weekly-jobs.yml deleted file mode 100644 index 018248871..000000000 --- a/jjb/qtip/qtip-weekly-jobs.yml +++ /dev/null @@ -1,108 +0,0 @@ -################# -# QTIP weekly job -################# -- project: - name: qtip-weekly - project: qtip - -#-------------------------------- -# BRANCH ANCHORS -#-------------------------------- - danube: &danube - stream: danube - branch: 'stable/{stream}' - gs-pathname: '/{stream}' - docker-tag: 'stable' - -#-------------------------------- -# JOB VARIABLES -#-------------------------------- - pod: - - zte-pod1: - installer: fuel - scenario: os-odl_l2-nofeature-ha - <<: *danube - - zte-pod3: - installer: fuel - scenario: os-nosdn-nofeature-ha - <<: *danube - - zte-pod3: - installer: fuel - scenario: os-nosdn-kvm-ha - <<: *danube - -#-------------------------------- -# JOB LIST -#-------------------------------- - jobs: - - 'qtip-{scenario}-{pod}-weekly-{stream}' - -################################ -# job templates -################################ -- job-template: - name: 'qtip-{scenario}-{pod}-weekly-{stream}' - disabled: false - parameters: - - project-parameter: - project: '{project}' - branch: '{branch}' - - '{installer}-defaults' - - '{pod}-defaults' - - string: - name: DEPLOY_SCENARIO - default: '{scenario}' - - string: - name: DOCKER_TAG - default: '{docker-tag}' - description: 'Tag to pull docker image' - - string: - name: CI_DEBUG - default: 'false' - description: "Show debug output information" - scm: - - git-scm - triggers: - - 'qtip-{scenario}-{pod}-weekly-{stream}-trigger' - builders: - - description-setter: - description: "POD: $NODE_NAME" - - qtip-validate-deploy-weekly - publishers: - - email: - recipients: wu.zhihui1@zte.com.cn, zhang.yujunz@zte.com.cn - - email-jenkins-admins-on-failure - -################ -# MARCOS -################ - -#--------- -# builder -#--------- -- builder: - name: qtip-validate-deploy-weekly - builders: - - shell: - !include-raw: ./helpers/cleanup-deploy.sh - - shell: - !include-raw: ./helpers/validate-deploy.sh - -#--------- -# trigger -#--------- - -- trigger: - name: 'qtip-os-odl_l2-nofeature-ha-zte-pod1-weekly-danube-trigger' - triggers: - - timed: '0 7 * * 0' - -- trigger: - name: 'qtip-os-nosdn-kvm-ha-zte-pod3-weekly-danube-trigger' - triggers: - - timed: '0 7 * * 0' - -- trigger: - name: 'qtip-os-nosdn-nofeature-ha-zte-pod3-weekly-danube-trigger' - triggers: - - timed: '30 0 * * 0'