e5730665133b3c93b26a27e21d50c141eff6e327
[ci-management.git] / jjb / scripts / vpp / csit-perf.sh
1 #!/usr/bin/env bash
2
3 # Copyright (c) 2020 Cisco and/or its affiliates.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at:
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15
16 echo "---> jjb/scripts/vpp/csit-perf.sh"
17
18 set -exuo pipefail
19
20 # Clone CSIT git repository and proceed with entry script located there.
21 #
22 # Variables read:
23 # - WORKSPACE - Jenkins workspace to create csit subdirectory in.
24 # - CSIT_REF - Override ref of CSIT git repository to checkout.
25 # Directories updated:
26 # - ${WORKSPACE}/csit - Created, holding a checked out CSIT repository.
27 # - Multiple other side effects by entry script(s), see CSIT repository.
28
29 cd "${WORKSPACE}"
30 git clone https://gerrit.fd.io/r/csit --depth=1 --no-single-branch --no-checkout
31 pushd "${WORKSPACE}/csit"
32 if [[ -n "${CSIT_REF-}" ]]; then
33     git fetch --depth=1 https://gerrit.fd.io/r/csit "${CSIT_REF}"
34     git checkout FETCH_HEAD
35 else
36     git checkout HEAD
37 fi
38 popd
39 csit_entry_dir="${WORKSPACE}/csit/resources/libraries/bash/entry"
40 source "${csit_entry_dir}/with_oper_for_vpp.sh" "per_patch_perf.sh"