Luca Prete | 706dbc5 | 2016-08-16 11:57:41 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # dist-setup.sh |
| 3 | # |
| 4 | # Runs as distributed user. |
| 5 | # |
| 6 | # Sets up the distributed ONOS tutorial. |
| 7 | |
| 8 | export USER=distributed |
| 9 | export USER_HOME=/home/${USER} |
| 10 | |
| 11 | echo "Creating distributed tutorial" |
| 12 | |
Luca Prete | b73729b | 2016-08-16 14:41:12 -0700 | [diff] [blame] | 13 | IDEA_URL=https://download.jetbrains.com/idea/ideaIC-2016.2.2.tar.gz |
Luca Prete | 706dbc5 | 2016-08-16 11:57:41 -0700 | [diff] [blame] | 14 | |
| 15 | cd ~ |
| 16 | |
| 17 | git clone https://github.com/bocon13/onos-byon.git |
| 18 | cd onos-byon |
Luca Prete | b73729b | 2016-08-16 14:41:12 -0700 | [diff] [blame] | 19 | git checkout started-1.6.0 |
Luca Prete | 706dbc5 | 2016-08-16 11:57:41 -0700 | [diff] [blame] | 20 | |
| 21 | # Pull ONOS code into local repo to compile against |
| 22 | mkdir -p .m2/repository/org |
| 23 | cp -r /home/mininet/.m2/repository/org/onosproject .m2/repository/org |
| 24 | |
| 25 | sed -i -e 's/open/xdg-open/' ~/onos/tools/test/bin/onos-gui |
| 26 | |
| 27 | echo "export KARAF_TAR=/home/mininet/apache-karaf-3.0.5.tar.gz" >> ~/.bashrc |
| 28 | echo "cell 3node > /dev/null" >> ~/.bashrc |
| 29 | |
| 30 | |
| 31 | cat > ~/startmn.sh << EOF |
| 32 | #!/bin/bash |
| 33 | sudo python ~/onos/tools/test/topos/sol.py \$OC1 \$OC2 \$OC3 |
| 34 | EOF |
| 35 | |
| 36 | chmod +x ~/startmn.sh |
| 37 | |
| 38 | DESKTOP=${USER_HOME}/Desktop |
| 39 | |
| 40 | mkdir -p ${DESKTOP} |
| 41 | |
| 42 | cat > ${DESKTOP}/IntelliJ << EOF |
| 43 | [Desktop Entry] |
| 44 | Encoding=UTF-8 |
| 45 | Type=Application |
| 46 | Name=IntelliJ |
| 47 | Name[en_US]=IntelliJ |
| 48 | Icon=/home/distributed/Applications/idea/bin/idea.png |
| 49 | Exec=/home/distributed/Applications/idea/bin/idea.sh |
| 50 | Comment[en_US]= |
| 51 | EOF |
| 52 | |
| 53 | cat > ${DESKTOP}/Tutorial << EOF |
| 54 | [Desktop Entry] |
| 55 | Encoding=UTF-8 |
| 56 | Type=Application |
| 57 | Name=ONOS Tutorial |
| 58 | Name[en_US]=ONOS Tutorial |
| 59 | Icon=internet-web-browser |
| 60 | Exec=/usr/bin/chromium-browser https://wiki.onosproject.org/display/ONOS/Distributed+ONOS+Tutorial |
| 61 | Comment[en_US]= |
| 62 | EOF |
| 63 | |
| 64 | |
| 65 | cat > ${DESKTOP}/Wireshark << EOF |
| 66 | [Desktop Entry] |
| 67 | Encoding=UTF-8 |
| 68 | Type=Application |
| 69 | Name=Wireshark |
| 70 | Name[en_US]=Wireshark |
| 71 | Icon=wireshark |
| 72 | Exec=/usr/bin/wireshark |
| 73 | Comment[en_US]= |
| 74 | EOF |
| 75 | |
| 76 | cat > ${DESKTOP}/Terminal << EOF |
| 77 | [Desktop Entry] |
| 78 | Encoding=UTF-8 |
| 79 | Name=LXTerminal |
| 80 | TryExec=lxterminal |
| 81 | Exec=lxterminal |
| 82 | Icon=lxterminal |
| 83 | Type=Application |
| 84 | Categories=GTK;Utility;TerminalEmulator; |
| 85 | EOF |
| 86 | |
| 87 | cat > ${DESKTOP}/Reset << EOF |
| 88 | [Desktop Entry] |
| 89 | Encoding=UTF-8 |
| 90 | Type=Application |
| 91 | Name=Reset |
| 92 | Name[en_US]=Reset |
| 93 | Icon=konsole |
| 94 | Exec=/usr/bin/lxterminal -t 'Resetting; please wait' -e '/bin/bash -c /home/mininet/reset-to-3.sh' |
| 95 | Comment[en_US]= |
| 96 | EOF |
| 97 | |
| 98 | sudo apt-get install -y git-review |
| 99 | |
| 100 | # Install IntelliJ |
| 101 | mkdir ~/Applications |
| 102 | cd ~/Applications |
| 103 | |
| 104 | wget -c -N -O /tmp/idea.tar.gz ${IDEA_URL} |
| 105 | tar xzf /tmp/idea.tar.gz |
Luca Prete | 32a1fdb | 2016-08-16 15:00:41 -0700 | [diff] [blame^] | 106 | sudo mv idea-IC-162.1628.40 idea |
Luca Prete | 706dbc5 | 2016-08-16 11:57:41 -0700 | [diff] [blame] | 107 | |
| 108 | cd - |