Jonathan Hart | 7b6cfef | 2015-03-27 10:09:38 -0700 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | # onos-setup-lxc.sh |
| 3 | # |
| 4 | # This script sets up the VM ready to run ONOS and tutorials, including installing an LXC cluster |
| 5 | # for ONOS to run in. |
| 6 | |
| 7 | # -------------- Install ONOS ---------------- |
| 8 | |
| 9 | USER=mininet |
| 10 | USER_HOME=/home/${USER} |
| 11 | |
| 12 | echo `whoami` |
| 13 | |
| 14 | cd ~ |
| 15 | git clone https://gerrit.onosproject.org/onos |
| 16 | cd onos && git checkout 1.1.0 && cd - |
| 17 | |
| 18 | #echo "export ONOS_ROOT=${USER_HOME}/onos" >> ~/.bashrc |
| 19 | #echo ". ~/onos/tools/dev/bash_profile" >> ~/.bashrc |
| 20 | |
| 21 | export ONOS_ROOT=${USER_HOME}/onos |
| 22 | . ~/onos/tools/dev/bash_profile |
| 23 | |
| 24 | echo $ONOS_ROOT |
| 25 | |
| 26 | echo $JAVA_HOME |
| 27 | export JAVA_HOME="" |
| 28 | cd $ONOS_ROOT && mvn clean install && mvn dependency:go-offline && cd - |
| 29 | |
| 30 | cat << EOF >> onos/tools/test/cells/tutorial |
| 31 | export ONOS_NIC=10.0.3.* |
| 32 | export OC1="10.0.3.11" |
| 33 | export OC1="10.0.3.12" |
| 34 | export OC1="10.0.3.13" |
| 35 | export OCI="${OC1}" |
| 36 | export ONOS_FEATURES="webconsole,onos-rest,onos-gui,onos-api,onos-core,onos-cli,onos-openflow" |
| 37 | export ONOS_USER="sdn" |
| 38 | EOF |
| 39 | |
| 40 | cell tutorial |
| 41 | |
| 42 | onos-package |
| 43 | onos-group install -f |
| 44 | onos-wait-for-start $OC1 |
| 45 | onos-wait-for-start $OC2 |
| 46 | onos-wait-for-start $OC3 |
| 47 | |
| 48 | sleep 20 |
| 49 | onos 1 "nodes" |