chiark / gitweb /
4c050170402ad39b118b26a8de3dcda774182101
[fdroidserver.git] / Vagrantfile
1
2
3 Vagrant.configure("2") do |config|
4   config.vm.box = "debian/jessie64"
5   # Disable default /vagrant folder rsync
6   config.vm.synced_folder ".", "/vagrant", disabled: true
7   config.disksize.size = '60GB'
8
9   config.vm.provision "shell", inline: <<-SHELL
10     sudo apt-get update && sudo apt-get install -y parted
11     sudo swapoff /dev/sda5 # disable swap so we can then remove the partition
12     sudo parted /dev/sda rm 5 rm 2 # remove swap and extended partition
13     # Extend sda1 to the full disk. Yes, this needs three dashes. See
14     # https://unix.stackexchange.com/a/365657/126364.
15     sudo parted ---pretend-input-tty /dev/sda resizepart 1 yes 100%
16     sudo resize2fs /dev/sda1 # enlarge filesystem to fill the whole partition
17     sudo dd if=/dev/zero of=/swap bs=1024K count=500 # create a swapfile
18     sudo chmod 600 /swap
19     sudo mkswap /swap
20     sudo swapon /swap
21     sudo sed -i '/swap/d' /etc/fstab # and update fstab with the swapfile
22     echo "/swap       none    swap    sw   0   0" | sudo tee -a /etc/fstab
23   SHELL
24 end
25