include-raw-sweetcomb-build.sh revision a682abc4
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
11function 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
33setup
34
35echo "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
42echo "*******************************************************************"
43echo "* SWEETCOMB BUILD SUCCESSFULLY COMPLETED"
44echo "*******************************************************************"
45