Merge "Set the daily mrr jobs cadence to normal"
[ci-management.git] / docker / scripts / dbld_vpp_install_packages.sh
1 #! /bin/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 set -euxo pipefail
17
18 export CIMAN_DOCKER_SCRIPTS=${CIMAN_DOCKER_SCRIPTS:-"$(dirname $BASH_SOURCE)"}
19 . $CIMAN_DOCKER_SCRIPTS/lib_vpp.sh
20 . $CIMAN_DOCKER_SCRIPTS/lib_apt.sh
21 . $CIMAN_DOCKER_SCRIPTS/lib_yum.sh
22 . $CIMAN_DOCKER_SCRIPTS/lib_dnf.sh
23
24 must_be_run_as_root
25 must_be_run_in_docker_build
26
27 echo_log
28 echo_log "Starting  $(basename $0)"
29
30 do_git_config vpp
31 for branch in ${VPP_BRANCHES[$OS_NAME]} ; do
32     do_git_branch $branch
33
34     # Install OS packages
35     make_vpp "install-dep" $branch
36     make_vpp "centos-pyyaml" $branch # VPP Makefile tests for centos versions
37     if [ "$OS_ID" = "ubuntu" ] ; then
38         # TODO: fix VPP stable/2005 bug in sphinx-make.sh
39         #       which fails on 'yum install python3-venv'
40         #       that does not exist.
41         # 'Make docs jobs are only run on ubuntu executors
42         #  so only run for ubuntu build executors until fixed.
43         make_vpp "docs-venv" $branch
44     elif [ "$OS_NAME" = "debian-9" ] ; then
45         apt_override_cmake_install_with_pip3_version
46     fi
47
48     # Download, build, and cache external deps packages
49     make_vpp "install-ext-deps" $branch
50     set +e
51     vpp_ext_dir="$DOCKER_VPP_DIR/build/external"
52     [ -d "$vpp_ext_dir/downloads" ] \
53         && rsync -ac $vpp_ext_dir/downloads/. $DOCKER_DOWNLOADS_DIR
54     [ -n "$(ls $vpp_ext_dir/*.deb)" ] \
55         && rsync -ac $vpp_ext_dir/*.deb $DOCKER_DOWNLOADS_DIR
56     [ -n "$(ls $vpp_ext_dir/*.rpm)" ] \
57         && rsync -ac $vpp_ext_dir/*.rpm $DOCKER_DOWNLOADS_DIR
58     set -e
59
60     # Install/cache python packages
61     if [ "$OS_ID" = "ubuntu" ] ; then
62         make_vpp_test "test-dep" $branch
63         make_vpp_test "doc" $branch
64         make_vpp test-wipe $branch
65         make_vpp "bootstrap-doxygen" $branch
66     fi
67
68     # Dump packages installed
69     case "$DOCKERFILE_FROM" in
70         *ubuntu*)
71             dump_apt_package_list $branch ;;
72         *debian*)
73             dump_apt_package_list $branch ;;
74         *centos:7)
75             dump_yum_package_list $branch ;;
76         *centos:8)
77             dump_dnf_package_list $branch ;;
78     esac
79 done
80
81 echo_log -e "Completed $(basename $0)!\n\n=========="