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