4 # check BRANCH_ID value
5 if [ "$BRANCH_ID" == "" ]; then
6 echo "branch_id not provided => 'master' will be used"
10 # make sure there is no csit directory
11 if [ -d "./csit/" ]; then
16 git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit
18 # if the git clone fails, complain clearly and exit
20 echo "Failed to run: git clone --depth 1 --no-single-branch https://gerrit.fd.io/r/csit"
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))
29 if [ "${BRANCH_NAME}" == "" ]; then
30 echo "No verified version found for requested branch - exiting"
34 # remove 'origin/' from the branch name
35 BRANCH_NAME=$(echo ${BRANCH_NAME#origin/})
37 # checkout to the required branch
38 git checkout ${BRANCH_NAME}
40 # execute csit bootstrap script if it exists
41 if [ -e bootstrap-verify-perf.sh ]
43 # make sure that bootstrap.sh is executable
44 chmod +x bootstrap-verify-perf.sh
46 ./bootstrap-verify-perf.sh
48 echo 'ERROR: No bootstrap-verify-perf.sh found'
52 # vim: ts=4 ts=4 sts=4 et :