Convert deb_dpdk to be Packer compliant
[ci-management.git] / jjb / scripts / setup_vpp_plugin_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     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         echo "deb ${REPO_URL} ./" | sudo tee /etc/apt/sources.list.d/99fd.io.list
28         sudo apt-get update
29         sudo apt-get -y --force-yes install vpp-dev vpp-lib
30     elif [[ $DISTRIB_ID == "CentOS" ]]; then
31         sudo cat << EOF > fdio-master.repo
32 [fdio-master]
33 name=fd.io master branch latest merge
34 baseurl=${REPO_URL}
35 enabled=1
36 gpgcheck=0
37 EOF
38         sudo mv fdio-master.repo /etc/yum.repos.d/fdio-master.repo
39         sudo yum -y install vpp-devel vpp-lib
40     fi
41 }
42
43 setup