blob: 77cb5eb56b5cea067de1980c5c303c1480e9d877 [file] [log] [blame]
Javi Merinoff1749d2016-02-03 14:23:10 +00001# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
Michele Di Giorgio65eceaa2016-05-24 11:40:22 +01004
Javi Merinoff1749d2016-02-03 14:23:10 +00005Vagrant.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 Giorgio65eceaa2016-05-24 11:40:22 +010018 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 Merinoff1749d2016-02-03 14:23:10 +000023 sudo pip install ipython[notebook] pandas
24 sudo apt-get remove -y w3m
25
26 ln -s /vagrant /home/vagrant/lisa
Michele Di Giorgio65eceaa2016-05-24 11:40:22 +010027
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 \
36 -t tool,platform-tool,platform;
37 expect {
38 "Do you accept the license" { exp_send "y\r" ; exp_continue }
39 eof
40 }
41 '
42 fi
43
Javi Merinoff1749d2016-02-03 14:23:10 +000044 chown vagrant.vagrant /home/vagrant/lisa
45 echo cd /home/vagrant/lisa >> /home/vagrant/.bashrc
Michele Di Giorgio91a28422016-05-11 12:23:08 +010046 for LC in $(locale | cut -d= -f1);
47 do
48 echo unset $LC >> /home/vagrant/.bashrc
49 done
Michele Di Giorgio65eceaa2016-05-24 11:40:22 +010050 echo "export ANDROID_HOME=/vagrant/tools/android-sdk-linux" >> /home/vagrant/.bashrc
51 echo "export PATH=$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools:$PATH" >> /home/vagrant/.bashrc
Javi Merinoff1749d2016-02-03 14:23:10 +000052 echo source init_env >> /home/vagrant/.bashrc
Michele Di Giorgio57992d52016-06-24 17:10:10 +010053
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 Merinoff1749d2016-02-03 14:23:10 +000065 SHELL
66end