aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-packages.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/build-packages.sh')
-rw-r--r--scripts/build-packages.sh65
1 files changed, 30 insertions, 35 deletions
diff --git a/scripts/build-packages.sh b/scripts/build-packages.sh
index bc386c398..dddc98deb 100644
--- a/scripts/build-packages.sh
+++ b/scripts/build-packages.sh
@@ -1,4 +1,4 @@
-# Copyright (c) 2017-2019 Cisco and/or its affiliates.
+# Copyright (c) 2017-2022 Cisco and/or its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
@@ -17,6 +17,20 @@ set -euxo pipefail
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE}")" ; pwd -P )
source ${SCRIPT_PATH}/functions.sh
+BUILD_PATH="${SCRIPT_PATH}/../packages"
+TEST_REPORT_DIR="${BUILD_PATH}/reports"
+BUILD_ROOT_DIR="${BUILD_PATH}/build-root/bin"
+MAKE_FOLDER="${SCRIPT_PATH}/.."
+
+function execute_tests() {
+ mkdir -p "${TEST_REPORT_DIR}"
+ pushd "${BUILD_ROOT_DIR}"
+ for component in "${TEST_COMPONENTS[@]}"; do
+ GTEST_OUTPUT="xml:${TEST_REPORT_DIR}/${component}-report.xml" "./${component}_tests"
+ done
+ popd
+}
+
# Parameters:
# $1 = Package name
#
@@ -27,22 +41,18 @@ function build_package() {
echo "********************* STARTING PACKAGE BUILD **********************"
echo "*******************************************************************"
- # Make the package
- mkdir -p ${SCRIPT_PATH}/../build && pushd ${SCRIPT_PATH}/../build
- rm -rf *
-
- cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr \
- -DBUILD_HICNPLUGIN=ON \
- -DBUILD_LIBTRANSPORT=ON \
- -DBUILD_APPS=ON \
- -DBUILD_HICNLIGHT=ON \
- -DBUILD_TELEMETRY=ON \
- ${SCRIPT_PATH}/..
+ # Run unit tests and make the package
+ make -C "${MAKE_FOLDER}" BUILD_PATH="${BUILD_PATH}" INSTALL_PREFIX=/usr package-release
- ninja -j8 package
+ execute_tests
- find . -not -name '*.deb' -not -name '*.rpm' -print0 | xargs -0 rm -rf -- || true
- rm *Unspecified* *Development* *development* || true
+ pushd "${BUILD_PATH}"
+ find . -not -name '*.deb' \
+ -not -name '*.rpm' \
+ -not -name 'reports' \
+ -not -name '*report.xml' \
+ -print0 | xargs -0 rm -rf -- || true
+ rm ./*Unspecified* ./*Development* ./*development* || true
popd
echo "*******************************************************************"
@@ -57,30 +67,15 @@ build_sphinx() {
echo "********************* STARTING DOC BUILD **************************"
echo "*******************************************************************"
- # Make the package
- pip3 install -r ${SCRIPT_PATH}/../docs/etc/requirements.txt
- pushd ${SCRIPT_PATH}/../docs
- make html
-
- popd
+ make doc
echo "*******************************************************************"
echo "***************** BUILD COMPLETED SUCCESSFULLY *******************"
echo "*******************************************************************"
}
-build_doxygen() {
- setup
-
- mkdir -p ${SCRIPT_PATH}/../build-doxygen
- pushd ${SCRIPT_PATH}/../build-doxygen
- cmake -DBUILD_HICNPLUGIN=On -DBUILD_HICNLIGHT=OFF -DBUILD_LIBTRANSPORT=OFF -DBUILD_UTILS=OFF -DBUILD_APPS=OFF -DBUILD_CTRL=OFF ..
- make doc
- popd
-}
-
function usage() {
- echo "Usage: ${0} [sphinx|doxygen|packages]"
+ echo "Usage: ${0} [sphinx|packages]"
exit 1
}
@@ -92,14 +87,14 @@ case "${1}" in
sphinx)
build_sphinx
;;
- doxygen)
- build_doxygen
- ;;
packages)
build_package
;;
+ vpp_master)
+ ;;
*)
usage
+ exit 1
esac
exit 0