Merge "Add INFO.yaml verify job"
[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 ##container server node detection
6 grep search /etc/resolv.conf  || true
7
8 OS_ID=$(grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
9 OS_VERSION_ID=$(grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
10
11 echo OS_ID: $OS_ID
12 echo OS_VERSION_ID: $OS_VERSION_ID
13
14 function setup {
15     if ! [ -z ${REPO_NAME} ]; then
16         echo "INSTALLING VPP-DPKG-DEV from apt/yum repo"
17         REPO_URL="https://packagecloud.io/fdio/${STREAM}"
18         echo "REPO_URL: ${REPO_URL}"
19         # Setup by installing vpp-dev and vpp-lib
20         if [ "$OS_ID" == "ubuntu" ]; then
21             if [ -f /etc/apt/sources.list.d/99fd.io.list ];then
22                 echo "Deleting: /etc/apt/sources.list.d/99fd.io.list"
23                 sudo rm /etc/apt/sources.list.d/99fd.io.list
24             fi
25             curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.deb.sh | sudo bash
26         elif [ "$OS_ID" == "centos" ]; then
27             if [ -f /etc/yum.repos.d/fdio-master.repo ]; then
28                 echo "Deleting: /etc/yum.repos.d/fdio-master.repo"
29                 sudo rm /etc/yum.repos.d/fdio-master.repo
30             fi
31             curl -s https://packagecloud.io/install/repositories/fdio/${STREAM}/script.rpm.sh | sudo bash
32         fi
33     fi
34 }
35
36 setup
37
38 echo "Building using \"make build-root/build.sh\""
39 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-dep
40 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-dep-extra
41 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes install-vpp
42 [ "x${DRYRUN}" == "xTrue" ] || make UNATTENDED=yes build-package
43
44 echo "*******************************************************************"
45 echo "* SWEETCOMB BUILD SUCCESSFULLY COMPLETED"
46 echo "*******************************************************************"