Ignoring failure in update-java-alternatives
[ci-management.git] / jjb / vpp / include-raw-vpp-lite-build.sh
1 #!/bin/bash
2 # basic build script example
3 set -xe -o pipefail
4 # do nothing but print the current slave hostname
5 hostname
6 export CCACHE_DIR=/tmp/ccache
7 if [ -d $CCACHE_DIR ];then
8     echo $CCACHE_DIR exists
9     du -sk $CCACHE_DIR
10 else
11     echo $CCACHE_DIR does not exist.  This must be a new slave.
12 fi
13
14 echo "cat /etc/bootstrap.sha"
15 if [ -f /etc/bootstrap.sha ];then
16     cat /etc/bootstrap.sha
17 else
18     echo "Cannot find cat /etc/bootstrap.sha"
19 fi
20
21 echo "cat /etc/bootstrap-functions.sha"
22 if [ -f /etc/bootstrap-functions.sha ];then
23     cat /etc/bootstrap-functions.sha
24 else
25     echo "Cannot find cat /etc/bootstrap-functions.sha"
26 fi
27
28 echo "sha1sum of this script: ${0}"
29 sha1sum $0
30
31 # Check to make sure the patch doesn't need to be rebased
32 # Since there was a discontinuity, patches with a
33 # parent before 30d41ff need to be rebased
34
35 (git log --oneline | grep 30d41ff > /dev/null 2>&1);if [ $? != 0 ]; then REBASE_NEEDED="1";fi
36 (git log --oneline | grep fb0815d > /dev/null 2>&1);if [ $? == 0 ]; then VPP_REPO="1";fi
37 echo "REBASE_NEEDED: ${REBASE_NEEDED}"
38 echo "VPP_REPO: ${VPP_REPO}"
39
40 if [ "x${VPP_REPO}" == "x1" ]; then
41     if [ "x${REBASE_NEEDED}" == "x1" ]; then
42         echo "This patch to vpp is based on an old point in the tree that is likely"
43         echo "to fail verify."
44         echo "PLEASE REBASE PATCH ON THE CURRENT HEAD OF THE VPP REPO"
45         exit 1
46     fi
47 fi
48
49 # Make sure we are starting on java-7.  This catches bugs in the
50 # vpp build system that can occur on Ubuntu 14.04 when a user may
51 # have both java-7 and java-8 installed.
52 if [ ${OS} == ubuntu1404 ];then
53     sudo update-java-alternatives -s /usr/lib/jvm/java-1.7.0-openjdk-amd64 || echo 'ignoring failure'
54 fi
55
56 make UNATTENDED=yes install-dep
57 make PLATFORM=vpp_lite build-release
58
59 echo "*******************************************************************"
60 echo "* VPP BUILD SUCCESSFULLY COMPLETED"
61 echo "*******************************************************************"