Merge "Modify logs publisher"
[ci-management.git] / jjb / jvpp / include-raw-jvpp-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
40 echo "Building using \"make package\""
41 # ensure that we build from scratch
42 ./clean.sh
43 [[ "x${DRYRUN}" == "xTrue" ]] || cd Requirements && make UNATTENDED=yes install-dep && cd ..
44 [[ "x${DRYRUN}" == "xTrue" ]] || pwd
45 if [[ "${OS_ID}" == "centos" ]]; then
46     [[ "x${DRYRUN}" == "xTrue" ]] || /opt/rh/devtoolset-7/enable
47     [[ "x${DRYRUN}" == "xTrue" ]] || cmake3 . -DCMAKE_PROGRAM_PATH:PATH="/opt/rh/devtoolset-7/root/bin"
48 else
49     [[ "x${DRYRUN}" == "xTrue" ]] || cmake .
50 fi
51
52 [[ "x${DRYRUN}" == "xTrue" ]] || make package
53 # This will build deb or rpm JVPP package based on OS. Built packages are located in build-root/packages/
54
55 echo "*******************************************************************"
56 echo "* JVPP BUILD SUCCESSFULLY COMPLETED"
57 echo "*******************************************************************"