setup_vpp_plugin_dev_env.sh revision 1a8e2a69
1#!/bin/bash
2set -e -o pipefail
3
4#!/bin/bash
5set -e -o pipefail
6
7# Figure out what system we are running on
8if [ -f /etc/lsb-release ];then
9    . /etc/lsb-release
10elif [ -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`
16fi
17echo DISTRIB_ID: $DISTRIB_ID
18echo DISTRIB_RELEASE: $DISTRIB_RELEASE
19echo DISTRIB_CODENAME: $DISTRIB_CODENAME
20echo DISTRIB_DESCRIPTION: $DISTRIB_DESCRIPTION
21
22function setup {
23    REPO_URL="${NEXUSPROXY}/content/repositories/fd.io.${REPO_NAME}"
24    echo "REPO_URL: ${REPO_URL}"
25    # Setup by installing vpp-dev and vpp-lib
26    if [ $DISTRIB_ID == "Ubuntu" ]; then
27        sudo rm -f /etc/apt/sources.list.d/99fd.io.list
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 remove vpp-dev vpp-lib
31        sudo apt-get -y --force-yes install vpp-dev vpp-lib
32    elif [[ $DISTRIB_ID == "CentOS" ]]; then
33        sudo rm -f /etc/yum.repos.d/fdio-master.repo
34        sudo cat << EOF > fdio-master.repo
35[fdio-master]
36name=fd.io master branch latest merge
37baseurl=${REPO_URL}
38enabled=1
39gpgcheck=0
40EOF
41        sudo mv fdio-master.repo /etc/yum.repos.d/fdio-master.repo
42        sudo yum -y remove vpp-devel vpp-lib
43        sudo yum -y install vpp-devel vpp-lib
44    fi
45}
46
47setup