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