summaryrefslogtreecommitdiffstats
path: root/jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh
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/csit/include-raw-csit-vpp-verify-semiweekly.sh
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/csit/include-raw-csit-vpp-verify-semiweekly.sh')
-rw-r--r--jjb/csit/include-raw-csit-vpp-verify-semiweekly.sh47
1 files changed, 47 insertions, 0 deletions
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 :