Fix vpp merge jobs
[ci-management.git] / jjb / scripts / setup_vpp_dpdk_dev_env.sh
1 #!/bin/bash
2 set -e -o pipefail
3
4 #!/bin/bash
5 set -e -o pipefail
6
7 # Figure out what system we are running on
8 if [ -f /etc/lsb-release ];then
9     . /etc/lsb-release
10 elif [ -f /etc/redhat-release ];then
11     sudo yum install -y redhat-lsb
12     DISTRIB_ID=`lsb_release -si`
13     DISTRIB_RELEASE=`lsb_release -sr`
14     DISTRIB_CODENAME=`lsb_release -sc`
15     DISTRIB_DESCRIPTION=`lsb_release -sd`
16 fi
17 echo DISTRIB_ID: $DISTRIB_ID
18 echo DISTRIB_RELEASE: $DISTRIB_RELEASE
19 echo DISTRIB_CODENAME: $DISTRIB_CODENAME
20 echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
21
22 function setup {
23     echo "INSTALLING VPP-DPKG-DEV from apt/yum repo"
24     REPO_URL="${NEXUSPROXY}/content/repositories/fd.io.${REPO_NAME}"
25     echo "REPO_URL: ${REPO_URL}"
26     # Setup by installing vpp-dev and vpp-lib
27     if [ $DISTRIB_ID == "Ubuntu" ]; then
28         echo "deb ${REPO_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
29         sudo apt-get update
30         sudo apt-get -y --force-yes install vpp-dpdk-dev || true
31     elif [[ $DISTRIB_ID == "CentOS" ]]; then
32         sudo cat << EOF > fdio-master.repo
33 [fdio-master]
34 name=fd.io master branch latest merge
35 baseurl=${REPO_URL}
36 enabled=1
37 gpgcheck=0
38 EOF
39         sudo mv fdio-master.repo /etc/yum.repos.d/fdio-master.repo
40         sudo yum -y install vpp-dpdk-dev || true
41     fi
42 }
43
44 setup