Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
Michele Di Giorgio | 65eceaa | 2016-05-24 11:40:22 +0100 | [diff] [blame] | 4 | |
Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 5 | Vagrant.configure(2) do |config| |
| 6 | config.vm.box = "ubuntu/trusty64" |
| 7 | |
| 8 | # Compiling pandas requires 1Gb of memory |
| 9 | config.vm.provider "virtualbox" do |v| |
| 10 | v.memory = 1024 |
| 11 | end |
| 12 | |
| 13 | # Forward ipython notebook's port to the host |
| 14 | config.vm.network "forwarded_port", guest: 8888, host: 8888 |
| 15 | |
| 16 | config.vm.provision "shell", inline: <<-SHELL |
| 17 | sudo apt-get update |
Michele Di Giorgio | 65eceaa | 2016-05-24 11:40:22 +0100 | [diff] [blame] | 18 | sudo apt-get install -y autoconf automake build-essential expect git \ |
| 19 | libfreetype6-dev libpng12-dev libtool nmap openjdk-7-jdk \ |
| 20 | openjdk-7-jre pkg-config python-all-dev python-matplotlib \ |
| 21 | python-nose python-numpy python-pip python-zmq sshpass trace-cmd \ |
| 22 | tree wget |
Javi Merino | b5503e3 | 2016-08-10 16:21:03 +0100 | [diff] [blame^] | 23 | sudo pip install ipython[notebook] pandas psutil wrapt |
Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 24 | sudo apt-get remove -y w3m |
| 25 | |
| 26 | ln -s /vagrant /home/vagrant/lisa |
Michele Di Giorgio | 65eceaa | 2016-05-24 11:40:22 +0100 | [diff] [blame] | 27 | |
| 28 | cd /home/vagrant/lisa |
| 29 | ANDROID_SDK_URL="https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz" |
| 30 | if [ ! -e ./tools/android-sdk-linux ]; then |
| 31 | echo "Downloading Android SDK [$ANDROID_SDK_URL]..." |
| 32 | wget -qO- $ANDROID_SDK_URL | tar xz -C tools |
| 33 | expect -c ' |
| 34 | set timeout -1; |
| 35 | spawn ./tools/android-sdk-linux/tools/android update sdk --no-ui \ |
Javi Merino | 48939b4 | 2016-07-21 13:57:31 +0100 | [diff] [blame] | 36 | -t tool,platform-tool,platform,build-tools-24.0.1; |
Michele Di Giorgio | 65eceaa | 2016-05-24 11:40:22 +0100 | [diff] [blame] | 37 | expect { |
| 38 | "Do you accept the license" { exp_send "y\r" ; exp_continue } |
| 39 | eof |
| 40 | } |
| 41 | ' |
| 42 | fi |
| 43 | |
Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 44 | chown vagrant.vagrant /home/vagrant/lisa |
| 45 | echo cd /home/vagrant/lisa >> /home/vagrant/.bashrc |
Michele Di Giorgio | 91a2842 | 2016-05-11 12:23:08 +0100 | [diff] [blame] | 46 | for LC in $(locale | cut -d= -f1); |
| 47 | do |
| 48 | echo unset $LC >> /home/vagrant/.bashrc |
| 49 | done |
Michele Di Giorgio | 65eceaa | 2016-05-24 11:40:22 +0100 | [diff] [blame] | 50 | echo "export ANDROID_HOME=/vagrant/tools/android-sdk-linux" >> /home/vagrant/.bashrc |
Javi Merino | 77aceb8 | 2016-07-21 11:09:05 +0100 | [diff] [blame] | 51 | echo 'export PATH=\$ANDROID_HOME/platform-tools:\$ANDROID_HOME/tools:\$PATH' >> /home/vagrant/.bashrc |
Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 52 | echo source init_env >> /home/vagrant/.bashrc |
Michele Di Giorgio | 57992d5 | 2016-06-24 17:10:10 +0100 | [diff] [blame] | 53 | |
| 54 | echo "Virtual Machine Installation completed successfully! " |
| 55 | echo " " |
| 56 | echo "You can now access and use the virtual machine by running: " |
| 57 | echo " " |
| 58 | echo " $ vagrant ssh " |
| 59 | echo " " |
| 60 | echo "NOTE: if you exit, the virtual machine is still running. To shut it " |
| 61 | echo " down, please run: " |
| 62 | echo " " |
| 63 | echo " $ vagrant suspend " |
| 64 | echo " " |
Javi Merino | ff1749d | 2016-02-03 14:23:10 +0000 | [diff] [blame] | 65 | SHELL |
| 66 | end |