Add CSIT nightly verify job for Centos7 39/7239/2
authorJan Gelety <jgelety@cisco.com>
Wed, 21 Jun 2017 07:44:47 +0000 (09:44 +0200)
committerJan Gelety <jgelety@cisco.com>
Wed, 21 Jun 2017 08:13:17 +0000 (10:13 +0200)
- add CSTI nighty job that download the latest vpp rpm packages from
  Nexus and test them against the latest verified CSIT codebase

Change-Id: Ib0cf8b8c913cf0a738c5d4341fbbdb5a634ea234
Signed-off-by: Jan Gelety <jgelety@cisco.com>
jjb/csit/csit.yaml
jjb/csit/include-raw-csit-vpp-verify-nightly.sh [new file with mode: 0644]

index 71f91a3..8f5ee13 100644 (file)
@@ -32,9 +32,6 @@
         - master:
             branch: 'master'
             branch-id: 'oper'
-        - '1704':
-            branch: 'rls1704'
-            branch-id: 'oper-rls1704'
     stream:
         - master:
             branch: 'master'
         - fdio-infra-shiplogs:
             maven-version: 'mvn33-new'
 
+- job-template:
+    name: 'csit-vpp-verify-{stream_timed}-centos7-nightly'
+    description: 'Purpose of this job is to validate latest centos7 vpp build from corresponding branch stored in nexus against verified CSIT codebase of corresponding branch.'
+
+    project-type: freestyle
+    node: centos7-basebuild-4c-4g'
+    concurrent: false
+
+    logrotate:
+        daysToKeep: '{build-days-to-keep}'
+        numToKeep: '{build-num-to-keep}'
+        artifactDaysToKeep: '{build-artifact-days-to-keep}'
+        artifactNumToKeep: '{build-artifact-num-to-keep}'
+
+    parameters:
+        - project-parameter:
+            project: '{project}'
+        - gerrit-parameter:
+            branch: '{branch}'
+
+    scm:
+        - git-scm:
+            credentials-id: 'jenkins-gerrit-credentials'
+            branch: '{branch}'
+
+    wrappers:
+        - fdio-infra-wrappers:
+            build-timeout: '{build-timeout}'
+
+    triggers:
+        - timed: 'H H(3-4) * * *'
+
+        - gerrit-trigger-manually-triggered:
+            comment-trigger-value: 'vpp-verify-func-centos7'
+            name: '{project}'
+            branch: '{branch}'
+
+    builders:
+        - shell: 'echo "BRANCH_ID={branch-id}" > $WORKSPACE/variables.prop'
+        - inject:
+            properties-file: variables.prop
+        - shell:
+            !include-raw-escape: jjb/csit/include-raw-csit-vpp-verify-nightly.sh
+
+    publishers:
+        - archive-artifacts:
+            artifacts: 'csit/archive/*.*'
+            latest-only: false
+
+        - robot-report:
+            output-path: 'csit/archive'
+
+        - fdio-infra-shiplogs:
+            maven-version: 'mvn33-new'
+
 - job-template:
     name: 'csit-vpp-verify-perf-master-nightly-all'
     description: 'Purpose of this job is to validate latest vpp build from corresponding branch stored in nexus against verified CSIT codebase of corresponding branch.'
diff --git a/jjb/csit/include-raw-csit-vpp-verify-nightly.sh b/jjb/csit/include-raw-csit-vpp-verify-nightly.sh
new file mode 100644 (file)
index 0000000..267072b
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash
+set -xeu -o pipefail
+
+# check BRANCH_ID value
+if [ "$BRANCH_ID" == "" ]; then
+    echo "branch_id not provided => 'master' will be used"
+    BRANCH_ID="master"
+fi
+
+# clone csit
+git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit
+
+# if the git clone fails, complain clearly and exit
+if [ $? != 0 ]; then
+    echo "Failed to run: git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit"
+    exit 1
+fi
+
+cd csit
+
+# get the latest verified version of the required branch
+BRANCH_NAME=$(echo $(git branch -r | grep -E "${BRANCH_ID}-[0-9]+" | tail -n 1))
+
+if [ "${BRANCH_NAME}" == "" ]; then
+    echo "No verified version found for requested branch - exiting"
+    exit 1
+fi
+
+# remove 'origin/' from the branch name
+BRANCH_NAME=$(echo ${BRANCH_NAME#origin/})
+
+# checkout to the required branch
+git checkout ${BRANCH_NAME}
+
+# execute csit bootstrap script if it exists
+if [ -e bootstrap-vpp-verify-nightly.sh ]
+then
+    # make sure that bootstrap.sh is executable
+    chmod +x bootstrap-vpp-verify-nightly.sh
+    # run the script
+    ./bootstrap-vpp-verify-nightly.sh
+else
+    echo 'ERROR: No bootstrap-vpp-verify-nightly.sh found'
+    exit 1
+fi
+
+# vim: ts=4 ts=4 sts=4 et :