summaryrefslogtreecommitdiffstats
path: root/jjb
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2016-06-17 00:09:01 +0200
committerJan Gelety <jgelety@cisco.com>2016-06-17 22:59:40 +0200
commit6d3f116521d77b37b543779f5e02cffb20dffaec (patch)
tree9d32fe90aad0a133ff57888d403a402c9d252aec /jjb
parent160449e191fa7c05d7b15d88fae8f7c11c771249 (diff)
Branching for csit-vpp-verify-semiweekly job
- introduce per branch semiweekly jobs: master, stable/1606 - check remote verified branches and use the latest one of the desired branch Change-Id: I715ee9e9c4732033bf7fd6a1fd25cdabe2c62e1d Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'jjb')
-rw-r--r--jjb/csit/csit.yaml17
-rw-r--r--jjb/csit/include-raw-csit-vpp-master-verify-semiweekly.sh21
-rw-r--r--jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh47
3 files changed, 54 insertions, 31 deletions
diff --git a/jjb/csit/csit.yaml b/jjb/csit/csit.yaml
index 7376cf84d..385668dcf 100644
--- a/jjb/csit/csit.yaml
+++ b/jjb/csit/csit.yaml
@@ -6,7 +6,7 @@
- 'csit-vpp-perf-{stream}-{type}'
- 'csit-vpp-functional-{stream}-virl'
- 'csit-vpp-verify-master-weekly'
- - 'csit-vpp-master-verify-semiweekly'
+ - 'csit-vpp-verify-{stream}-semiweekly'
project: 'csit'
branch: 'master'
@@ -315,8 +315,8 @@
- job-template:
- name: 'csit-vpp-master-verify-semiweekly'
- description: 'Purpose of this job is to validate latest vpp build stored in nexus against verified CSIT codebase.'
+ name: 'csit-vpp-verify-{stream}-semiweekly'
+ description: 'Purpose of this job is to validate latest vpp build from corresponding branch stored in nexus against verified CSIT codebase of corresponding branch.'
project-type: freestyle
node: verify
@@ -334,11 +334,6 @@
- gerrit-parameter:
branch: '{branch}'
- scm:
- - git-scm:
- credentials-id: '{ssh-credentials}'
- branch: 'master'
-
wrappers:
- ssh-agent-credentials:
users:
@@ -353,8 +348,11 @@
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-master-verify-semiweekly.sh
+ !include-raw-escape jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh
publishers:
- archive-artifacts:
@@ -366,7 +364,6 @@
- parameter:
name: test-type-parameter
-
parameters:
- string:
name: TYPE
diff --git a/jjb/csit/include-raw-csit-vpp-master-verify-semiweekly.sh b/jjb/csit/include-raw-csit-vpp-master-verify-semiweekly.sh
deleted file mode 100644
index 0b3226427..000000000
--- a/jjb/csit/include-raw-csit-vpp-master-verify-semiweekly.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-set -xeu -o pipefail
-
-# Clone csit and start tests
-git clone https://gerrit.fd.io/r/csit --branch csit-verified
-
-cd csit
-
-# execute csit bootstrap script if it exists
-if [ -e bootstrap-vpp-master-verify-semiweekly.sh ]
-then
- # make sure that bootstrap.sh is executable
- chmod +x bootstrap-vpp-master-verify-semiweekly.sh
- # run the script
- ./bootstrap-vpp-master-verify-semiweekly.sh
-else
- echo 'ERROR: No bootstrap-verify-master.sh found'
- exit 1
-fi
-
-# vim: ts=4 ts=4 sts=4 et :
diff --git a/jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh b/jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh
new file mode 100644
index 000000000..13df07490
--- /dev/null
+++ b/jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh
@@ -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 csit-verified-${BRANCH_ID} | 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-semiweekly.sh ]
+then
+ # make sure that bootstrap.sh is executable
+ chmod +x bootstrap-vpp-verify-semiweekly.sh
+ # run the script
+ ./bootstrap-vpp-verify-semiweekly.sh
+else
+ echo 'ERROR: No bootstrap-vpp-verify-semiweekly.sh found'
+ exit 1
+fi
+
+# vim: ts=4 ts=4 sts=4 et :