2 # basic build script example
4 # Copyright (c) 2020 Cisco and/or its affiliates.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at:
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 echo "---> jjb/scripts/vpp/build.sh"
21 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
22 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
25 echo "sha1sum of this script: ${0}"
28 # TODO: Mount ccache volume into docker container, then enable this.
30 #export CCACHE_DIR=/scratch/docker-build/ccache
31 #if [ -d $CCACHE_DIR ];then
35 # echo $CCACHE_DIR does not exist.
38 if [ "x${MAKE_PARALLEL_FLAGS}" != "x" ]
40 echo "Building VPP. Number of cores for build set with" \
41 "MAKE_PARALLEL_FLAGS='${MAKE_PARALLEL_FLAGS}'."
42 elif [ "x${MAKE_PARALLEL_JOBS}" != "x" ]
44 echo "Building VPP. Number of cores for build set with" \
45 "MAKE_PARALLEL_JOBS='${MAKE_PARALLEL_JOBS}'."
47 echo "Building VPP. Number of cores not set, " \
48 "using build default ($(grep -c ^processor /proc/cpuinfo))."
52 echo "IS_CSIT_VPP_JOB=${IS_CSIT_VPP_JOB}"
54 # If we are not a CSIT job just building packages, then use make verify,
55 # else use make pkg-verify.
56 if [ "x${IS_CSIT_VPP_JOB}" != "xTrue" ]
58 if [ "x${MAKE_PARALLEL_JOBS}" != "x" ]
60 export TEST_JOBS="${MAKE_PARALLEL_JOBS}"
61 echo "Testing VPP with ${TEST_JOBS} cores."
63 export TEST_JOBS="auto"
64 echo "Testing VPP with automatically calculated number of cores. " \
65 "See test logs for the exact number."
67 echo "Building using \"make verify\""
68 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes verify
70 echo "Building using \"make pkg-verify\""
71 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes pkg-verify
74 echo "*******************************************************************"
75 echo "* VPP ${OS_ID^^}-${OS_VERSION_ID}-${OS_ARCH^^} BUILD SUCCESSFULLY COMPLETED"
76 echo "*******************************************************************"