include-raw-jvpp-build.sh revision afa8332c
1#!/bin/bash
2# basic build script example
3set -xe -o pipefail
4
5OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
6OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
7
8echo OS_ID: ${OS_ID}
9echo OS_VERSION_ID: ${OS_VERSION_ID}
10
11# do nothing but print the current slave hostname
12hostname
13export CCACHE_DIR=/tmp/ccache
14if [[ -d ${CCACHE_DIR} ]];then
15    echo ${CCACHE_DIR} exists
16    du -sk ${CCACHE_DIR}
17else
18    echo ${CCACHE_DIR} does not exist.  This must be a new slave.
19fi
20
21echo "cat /etc/bootstrap.sha"
22if [[ -f /etc/bootstrap.sha ]];then
23    cat /etc/bootstrap.sha
24else
25    echo "Cannot find cat /etc/bootstrap.sha"
26fi
27
28echo "cat /etc/bootstrap-functions.sha"
29if [[ -f /etc/bootstrap-functions.sha ]];then
30    cat /etc/bootstrap-functions.sha
31else
32    echo "Cannot find cat /etc/bootstrap-functions.sha"
33fi
34
35echo "sha1sum of this script: ${0}"
36sha1sum $0
37
38echo "CC=${CC}"
39
40echo "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
45if [[ "${OS_ID}" == "centos" ]]; then
46    [[ "x${DRYRUN}" == "xTrue" ]] || cmake3 .
47else
48    [[ "x${DRYRUN}" == "xTrue" ]] || cmake .
49fi
50
51[[ "x${DRYRUN}" == "xTrue" ]] || make package
52# This will build deb or rpm JVPP package based on OS. Built packages are located in build-root/packages/
53
54echo "*******************************************************************"
55echo "* JVPP BUILD SUCCESSFULLY COMPLETED"
56echo "*******************************************************************"
57