blob: 183d763ec6849236b278bf9b885a87feef416bdd [file] [log] [blame]
Chetan Gaonkercc19ac42016-05-04 17:21:50 -07001#!/usr/bin/env bash
2apt-get update
A R Karthickd49ca4b2016-07-27 11:52:50 -07003on_cord=0
4if [ "$1" = "--cord" ]; then
5 echo "Skipping installation of Docker and ONOS"
6 on_cord=1
Chetan Gaonkercc19ac42016-05-04 17:21:50 -07007fi
A R Karthickd49ca4b2016-07-27 11:52:50 -07008if [ $on_cord -eq 0 ]; then
9 apt-get -y install apt-transport-https ca-certificates
10 apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
11 if [ ! -f /etc/apt/sources.list.d/docker.list ]; then
12 echo deb https://apt.dockerproject.org/repo ubuntu-trusty main | tee /etc/apt/sources.list.d/docker.list
13 fi
14 apt-get update
15 apt-get purge lxc-docker || true
16 apt-get -y install linux-image-extra-$(uname -r)
17 apt-get -y install apparmor
18 echo "Installing Docker"
19 apt-get -y install docker-engine
20 service docker start
21 echo "Verifying Docker installation"
22 docker run --rm hello-world || exit 127
23 docker rmi hello-world
24 echo "Pulling ONOS latest and 1.5"
25 docker pull onosproject/onos:latest || exit 127
26 docker pull onosproject/onos:1.5 || exit 127
27 apt-get -y install openvswitch-common openvswitch-switch
28fi
Chetan Gaonker0ff7e782016-05-06 11:57:33 -070029apt-get -y install wget git python python-dev python-pip python-setuptools python-scapy python-pexpect tcpdump arping
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070030easy_install nose
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070031pip install -U scapy
32pip install monotonic
33pip install configObj
34pip install -U docker-py
35pip install -U pyyaml
36pip install -U nsenter
37pip install -U pyroute2
38pip install -U netaddr
A R Karthickea9abc82016-06-17 14:55:19 -070039pip install -U python-daemon
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070040pip install scapy-ssl_tls
Chetan Gaonker66bff932016-05-09 10:06:37 -070041( cd /tmp && git clone https://github.com/jpetazzo/pipework.git && cp -v pipework/pipework /usr/bin && rm -rf pipework )
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070042## Special mode to pull cord-tester repo in case prereqs was installed by hand instead of repo
A R Karthickd49ca4b2016-07-27 11:52:50 -070043if [ "$1" = "--test" ]; then
Chetan Gaonkercc19ac42016-05-04 17:21:50 -070044 rm -rf cord-tester
A R Karthickd49ca4b2016-07-27 11:52:50 -070045 git clone https://github.com/opencord/cord-tester.git
Chetan Gaonker66bff932016-05-09 10:06:37 -070046fi