VPP: csit add unattended for install-dep
[ci-management.git] / jjb / vpp / include-raw-vpp-build.sh
1 #!/bin/bash
2 # basic build script example
3 set -xe -o pipefail
4
5 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
6 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
7
8 echo OS_ID: $OS_ID
9 echo OS_VERSION_ID: $OS_VERSION_ID
10
11 # do nothing but print the current slave hostname
12 hostname
13 export CCACHE_DIR=/tmp/ccache
14 if [ -d $CCACHE_DIR ];then
15     echo $CCACHE_DIR exists
16     du -sk $CCACHE_DIR
17 else
18     echo $CCACHE_DIR does not exist.  This must be a new slave.
19 fi
20
21 echo "cat /etc/bootstrap.sha"
22 if [ -f /etc/bootstrap.sha ];then
23     cat /etc/bootstrap.sha
24 else
25     echo "Cannot find cat /etc/bootstrap.sha"
26 fi
27
28 echo "cat /etc/bootstrap-functions.sha"
29 if [ -f /etc/bootstrap-functions.sha ];then
30     cat /etc/bootstrap-functions.sha
31 else
32     echo "Cannot find cat /etc/bootstrap-functions.sha"
33 fi
34
35 echo "sha1sum of this script: ${0}"
36 sha1sum $0
37
38 echo "CC=${CC}"
39 echo "IS_CSIT_VPP_JOB=${IS_CSIT_VPP_JOB}"
40 # If and only if we are doing verify *after* make verify was made to work
41 # and we are not a CSIT job just building packages, then use make verify,
42 # else use the old build-root/vagrant/build.sh
43 if (git log --oneline | grep 37682e1 > /dev/null 2>&1) && \
44         [ "x${IS_CSIT_VPP_JOB}" != "xTrue" ]
45 then
46     echo "Building using \"make verify\""
47     [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes verify
48 else
49     echo "Building using \"make build-root/vagrant/build.sh\""
50     [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-dep
51     [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes dpdk-install-dev
52     [ "x${DRYRUN}" == "xTrue" ] || build-root/vagrant/build.sh
53 fi
54
55 if [ "x${VPP_REPO}" == "x1" ]; then
56     if [ "x${REBASE_NEEDED}" == "x1" ]; then
57         echo "This patch to vpp is based on an old point in the tree that is likely"
58         echo "to fail verify."
59         echo "PLEASE REBASE PATCH ON THE CURRENT HEAD OF THE VPP REPO"
60         exit 1
61     fi
62 fi
63
64 echo "*******************************************************************"
65 echo "* VPP BUILD SUCCESSFULLY COMPLETED"
66 echo "*******************************************************************"