Merge "Configure DEB_DPDK Jenkins view"
[ci-management.git] / jjb / sweetcomb / include-raw-sweetcomb-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 function setup {
12     if ! [ -z ${REPO_NAME} ]; then
13         echo "INSTALLING VPP-DPKG-DEV from apt/yum repo"
14         REPO_URL="https://packagecloud.io/fdio/${STREAM}"
15         echo "REPO_URL: ${REPO_URL}"
16         # Setup by installing vpp-dev and vpp-lib
17         if [ "$OS_ID" == "ubuntu" ]; then
18             if [ -f /etc/apt/sources.list.d/99fd.io.list ];then
19                 echo "Deleting: /etc/apt/sources.list.d/99fd.io.list"
20                 sudo rm /etc/apt/sources.list.d/99fd.io.list
21             fi
22             curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.deb.sh | sudo bash
23         elif [ "$OS_ID" == "centos" ]; then
24             if [ -f /etc/yum.repos.d/fdio-master.repo ]; then
25                 echo "Deleting: /etc/yum.repos.d/fdio-master.repo"
26                 sudo rm /etc/yum.repos.d/fdio-master.repo
27             fi
28             curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.rpm.sh | sudo bash
29         fi
30     fi
31 }
32
33 setup
34
35 echo "Building using \"make build-root/build.sh\""
36 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-dep
37 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-dep-extra
38 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-vpp
39 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes build-scvpp
40 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes build
41
42 echo "*******************************************************************"
43 echo "* SWEETCOMB BUILD SUCCESSFULLY COMPLETED"
44 echo "*******************************************************************"