Check to see if a VPP patch needs rebasing
[ci-management.git] / jjb / vpp / include-raw-vpp-build.sh
1 #!/bin/bash
2 # basic build script example
3
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 # Check to make sure the patch doesn't need to be rebased
15 # Since there was a discontinuity, patches with a
16 # parent before 30d41ff need to be rebased
17
18 (git log --oneline | grep 30d41ff > /dev/null 2>&1);if [ $? != 0 ]; then REBASE_NEEDED="1";fi
19 (git log --oneline | grep fb0815d > /dev/null 2>&1);if [ $? == 0 ]; then VPP_REPO="1";fi
20 echo "REBASE_NEEDED: ${REBASE_NEEDED}"
21 echo "VPP_REPO: ${VPP_REPO}"
22
23 if [ "x${VPP_REPO}" == "x1" ]; then
24     if [ "x${REBASE_NEEDED}" == "x1" ]; then
25         echo "This patch to vpp is based on an old point in the tree that is likely"
26         echo "to fail verify."
27         echo "PLEASE REBASE PATCH ON THE CURRENT HEAD OF THE VPP REPO"
28         exit 1
29     fi
30 fi
31
32 # Make sure we are starting on java-7.  This catches bugs in the
33 # vpp build system that can occur on Ubuntu 14.04 when a user may
34 # have both java-7 and java-8 installed.
35 if [ ${OS} == ubuntu1404 ];then
36     sudo update-java-alternatives -s /usr/lib/jvm/java-1.7.0-openjdk-amd64
37 fi
38
39 build-root/vagrant/build.sh