Enable concurency for csit-vpp-perf-mrr-daily-master
[ci-management.git] / jjb / csit / include-raw-csit-vpp-perf-nightly.sh
1 #!/bin/bash
2 set -xeu -o pipefail
3
4 # check BRANCH_ID value
5 if [ "$BRANCH_ID" == "" ]; then
6     echo "branch_id not provided => 'master' will be used"
7     BRANCH_ID="master"
8 fi
9
10 #make sure there is no csit directory
11 if [ -d "./csit/" ]; then
12     rm -rf ./csit/
13 fi
14
15 # clone csit
16 git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit
17
18 # if the git clone fails, complain clearly and exit
19 if [ $? != 0 ]; then
20     echo "Failed to run: git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit"
21     exit 1
22 fi
23
24 cd csit
25
26 # get the latest verified version of the required branch
27 BRANCH_NAME=$(echo $(git branch -r | grep -E "${BRANCH_ID}-[0-9]+" | tail -n 1))
28
29 if [ "${BRANCH_NAME}" == "" ]; then
30     echo "No verified version found for requested branch - exiting"
31     exit 1
32 fi
33
34 # remove 'origin/' from the branch name
35 BRANCH_NAME=$(echo ${BRANCH_NAME#origin/})
36
37 # checkout to the required branch
38 git checkout ${BRANCH_NAME}
39
40 export TEST_TAG="PERFTEST_NIGHTLY"
41
42 # execute csit bootstrap script if it exists
43 if [ -e bootstrap-verify-perf.sh ]
44 then
45     # make sure that bootstrap.sh is executable
46     chmod +x bootstrap-verify-perf.sh
47     # run the script
48     ./bootstrap-verify-perf.sh
49 else
50     echo 'ERROR: No bootstrap-verify-perf.sh found'
51     exit 1
52 fi
53
54 # vim: ts=4 ts=4 sts=4 et :