Add a standalone job for checking VPP API CRCs
[ci-management.git] / jjb / vpp / check_crc.sh
1 #!/usr/bin/env bash
2
3 # Copyright (c) 2019 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 set -exuo pipefail
17
18 # Clone CSIT git repository and proceed with entry script located there.
19 #
20 # Variables read:
21 # - WORKSPACE - Jenkins workspace to create csit subdirectory in.
22 # - CSIT_REF - Override ref of CSIT git repository to checkout.
23 # Directories updated:
24 # - ${WORKSPACE}/csit - Created, holding a checked out CSIT repository.
25 # - Multiple other side effects by entry script(s), see CSIT repository.
26
27 cd "${WORKSPACE}"
28 git clone https://gerrit.fd.io/r/csit --depth=1 --no-single-branch --no-checkout
29 pushd "${WORKSPACE}/csit"
30 if [[ -n "${CSIT_REF-}" ]]; then
31     git fetch --depth=1 https://gerrit.fd.io/r/csit "${CSIT_REF}"
32     git checkout FETCH_HEAD
33 else
34     git checkout HEAD
35 fi
36 popd
37 csit_entry_dir="${WORKSPACE}/csit/resources/libraries/bash/entry"
38 source "${csit_entry_dir}/with_oper_for_vpp.sh" "check_crc.sh"