summaryrefslogtreecommitdiffstats
path: root/jjb/csit/include-raw-csit-perf-timed.sh
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-08-03 09:52:50 +0000
committerPeter Mikus <pmikus@cisco.com>2018-08-10 15:59:32 +0000
commit263247c552883c1867ebeb927a4babf2932bfabe (patch)
treece1e10088ce0324b325134dc44e0d5cabde14d43 /jjb/csit/include-raw-csit-perf-timed.sh
parent7a48620e96279ae99c2978bfd8e02bfc54e99d85 (diff)
CSIT-1193 Update of perf jobs
- Unify the bootstraps - Cleanup old jobs - Cleanup old branches - Add weekly NDRPDR jobs Change-Id: Icc1ad1fe002d9409e5fcd6e4aa0b674def07724e Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'jjb/csit/include-raw-csit-perf-timed.sh')
-rw-r--r--jjb/csit/include-raw-csit-perf-timed.sh52
1 files changed, 52 insertions, 0 deletions
diff --git a/jjb/csit/include-raw-csit-perf-timed.sh b/jjb/csit/include-raw-csit-perf-timed.sh
new file mode 100644
index 000000000..55605d732
--- /dev/null
+++ b/jjb/csit/include-raw-csit-perf-timed.sh
@@ -0,0 +1,52 @@
+#!/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
+
+# make sure there is no csit directory
+if [ -d "./csit/" ]; then
+ rm -rf ./csit/
+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-verify-perf.sh ]
+then
+ # make sure that bootstrap.sh is executable
+ chmod +x bootstrap-verify-perf.sh
+ # run the script
+ ./bootstrap-verify-perf.sh
+else
+ echo 'ERROR: No bootstrap-verify-perf.sh found'
+ exit 1
+fi
+
+# vim: ts=4 ts=4 sts=4 et :