e303ce28ef77f3ec43577eba1a717d227ab969b4
[ci-management.git] / docker / scripts / dbld_csit_install_packages.sh
1 #! /bin/bash
2
3 # Copyright (c) 2021 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 -euxo pipefail
17
18 export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"}
19 . "$CIMAN_DOCKER_SCRIPTS/lib_csit.sh"
20 . "$CIMAN_DOCKER_SCRIPTS/lib_vpp.sh"
21
22 must_be_run_in_docker_build
23
24 echo_log
25
26 if ! csit_supported_executor_class "$FDIOTOOLS_EXECUTOR_CLASS" ; then
27     echo_log "CSIT is not supported on executor class '$FDIOTOOLS_EXECUTOR_CLASS'. Skipping $(basename $0)..."
28     exit 0
29 elif ! csit_supported_os "$OS_NAME" ; then
30     echo_log "CSIT is not supported on OS '$OS_NAME'. Skipping $(basename $0)..."
31     exit 0
32 else
33     echo_log "Starting  $(basename $0)"
34 fi
35
36 do_git_config csit
37 for vpp_branch in ${VPP_BRANCHES[$OS_NAME]} ; do
38     # Returns checked out branch in csit_branch
39     csit_checkout_branch_for_vpp "$vpp_branch"
40
41     # Install csit OS packages
42     csit_install_packages "$csit_branch"
43
44     # Install/cache python packages
45     csit_install_hugo "$csit_branch"
46
47     # Install/cache python packages
48     csit_pip_cache "$csit_branch"
49 done
50
51 # Install csit OS packages
52 csit_install_packages "master"
53
54 # Install/cache python packages
55 csit_install_hugo "master"
56
57 # Install/cache python packages
58 csit_pip_cache "master"
59
60 echo_log -e "Completed $(basename $0)!\n\n=========="