[qtip] refactoring ci scripts 95/39395/3
authorYujun Zhang <zhang.yujunz@zte.com.cn>
Wed, 16 Aug 2017 07:51:15 +0000 (15:51 +0800)
committerYujun Zhang <zhang.yujunz@zte.com.cn>
Thu, 17 Aug 2017 04:00:12 +0000 (12:00 +0800)
- 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 <zhang.yujunz@zte.com.cn>
jjb/qtip/helpers/cleanup-deploy.sh [deleted file]
jjb/qtip/helpers/validate-deploy.sh [deleted file]
jjb/qtip/helpers/validate-setup.sh [deleted file]
jjb/qtip/qtip-experimental-jobs.yml [moved from jjb/qtip/qtip-integration-jobs.yml with 69% similarity]
jjb/qtip/qtip-validate-jobs.yml
jjb/qtip/qtip-weekly-jobs.yml [deleted file]

diff --git a/jjb/qtip/helpers/cleanup-deploy.sh b/jjb/qtip/helpers/cleanup-deploy.sh
deleted file mode 100644 (file)
index 9cb19a5..0000000
+++ /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 (file)
index af8f8c2..0000000
+++ /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 (file)
index 8d84e12..0000000
+++ /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
similarity index 69%
rename from jjb/qtip/qtip-integration-jobs.yml
rename to jjb/qtip/qtip-experimental-jobs.yml
index 4382dff..05445d8 100644 (file)
@@ -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
index 73d7993..e64173c 100644 (file)
 #--------------------------------
 # 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}'
             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
 #---------
 # builder
 #---------
-- builder:
-    name: qtip-validate-deploy
-    builders:
-        - shell:
-            !include-raw: ./helpers/cleanup-deploy.sh
-        - shell:
-            !include-raw: ./helpers/validate-deploy.sh
-
 
 #-----------
 # parameter
 #---------
 
 - 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 (file)
index 0182488..0000000
+++ /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'