| 1 | # -*- mode: ruby -*- |
| 2 | # vi: set ft=ruby : |
| 3 | |
| 4 | Vagrant.configure("2") do |config| |
| 5 | |
| 6 | config.vm.box = "ubuntu/artful64" |
| 7 | |
| 8 | # use vagrant-disksize plugin to resize partition - https://github.com/sprotheroe/vagrant-disksize |
| 9 | config.disksize.size = '50GB' |
| 10 | |
| 11 | config.vm.provider "virtualbox" do |vb| |
| 12 | # Customize the amount of memory on the VM |
| 13 | vb.memory = "2048" |
| 14 | end |
| 15 | |
| 16 | # Share the root of the repo |
| 17 | config.vm.synced_folder "../", "/termux-packages" |
| 18 | # Disable the default /vagrant share directory, as it shares the directory with the Vagrantfile in it, not the repo root |
| 19 | config.vm.synced_folder ".", "/vagrant", disabled: true |
| 20 | |
| 21 | # filesystem needs to be resized |
| 22 | config.vm.provision "shell", inline: "sudo resize2fs /dev/sda1" |
| 23 | |
| 24 | # helpful before setup-ubuntu.sh is run |
| 25 | config.vm.provision "shell", inline: "sudo apt-get update" |
| 26 | |
| 27 | # Run provisioning scripts |
| 28 | config.vm.provision "shell", path: "./setup-ubuntu.sh", privileged: false |
| 29 | config.vm.provision "shell", path: "./setup-android-sdk.sh", privileged: false |
| 30 | |
| 31 | # Fix permissions on the /data directory in order to allow the "vagrant" user to write to it |
| 32 | config.vm.provision "shell", |
| 33 | inline: "sudo chown -R vagrant /data" |
| 34 | |
| 35 | # Tell the user how to use the VM |
| 36 | config.vm.post_up_message = "Box has been provisioned! Use 'vagrant ssh' to enter the box. The repository root is available under '/termux-packages'." |
| 37 | end |