Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 1 | # Vagrantfile API/syntax version. Don't touch unless you know what you're |
| 2 | # doing! |
| 3 | VAGRANTFILE_API_VERSION = "2" |
| 4 | |
| 5 | # Install the necessary plugins. |
| 6 | required_plugins = %w( vagrant-persistent-storage ) |
| 7 | required_plugins.each do |plugin| |
| 8 | unless Vagrant.has_plugin? plugin || ARGV[0] == 'plugin' then |
| 9 | exec "vagrant plugin install #{plugin};vagrant #{ARGV.join(" ")}" |
| 10 | end |
| 11 | end |
| 12 | |
| 13 | Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
| 14 | # All Vagrant configuration is done here. The most common configuration |
| 15 | # options are documented and commented below. For a complete reference, |
| 16 | # please see the online documentation at vagrantup.com. |
| 17 | |
| 18 | # Every Vagrant virtual environment requires a box to build off of. |
Philipp Schrader | 85a71fa | 2017-12-20 19:35:22 -0800 | [diff] [blame^] | 19 | config.vm.box = "debian/jessie64" |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 20 | |
| 21 | config.vm.provider "virtualbox" do |vb| |
| 22 | # Don't boot with headless mode |
| 23 | vb.gui = true |
Philipp Schrader | 85a71fa | 2017-12-20 19:35:22 -0800 | [diff] [blame^] | 24 | vb.name = "FRC971-Development-2017" |
Isaac Wilcove | cfd9a03 | 2017-01-15 00:08:58 +0000 | [diff] [blame] | 25 | |
| 26 | # There are two shortcuts for modifying number of CPUs and amount of |
| 27 | # memory. Modify them to your liking. |
| 28 | vb.cpus = 2 |
| 29 | vb.memory = 1024 * 2 |
| 30 | end |
| 31 | |
| 32 | # Use rsync to sync the /vagrant folder. |
| 33 | # NOTE: If you change these settings they will not take effect until you |
| 34 | # reboot the VM -- i.e. run a "vagrant reload". |
| 35 | config.vm.synced_folder ".", "/vagrant", type: "rsync", |
| 36 | rsync__exclude: [".git/", ".svn/", "workspace.vdi"], rsync__verbose: true |
| 37 | |
| 38 | # Set up apt and install packages necessary for building the code. |
| 39 | config.vm.provision :shell, inline: "/vagrant/setup_apt.sh" |
| 40 | config.vm.provision :shell, inline: "/vagrant/setup_extra_storage.sh" |
| 41 | config.vm.provision :shell, inline: "/vagrant/setup_code_building.sh" |
| 42 | config.vm.provision :shell, inline: "/vagrant/setup_scouting.sh" |
| 43 | config.vm.provision :shell, inline: "/vagrant/setup_desktop.sh" |
| 44 | config.vm.provision :shell, inline: "/vagrant/setup_misc_packages.sh" |
| 45 | config.vm.provision :shell, inline: "/vagrant/setup_vbox_guest_additions.sh" |
| 46 | |
| 47 | # Add a second disk so we have plenty of space to compile the code. |
| 48 | config.persistent_storage.enabled = true |
| 49 | config.persistent_storage.location = "workspace.vdi" |
| 50 | config.persistent_storage.size = 40000 # MiB |
| 51 | config.persistent_storage.use_lvm = false |
| 52 | config.persistent_storage.filesystem = 'ext4' |
| 53 | config.persistent_storage.mountpoint = '/home/user' |
| 54 | |
| 55 | # Forward the scouting app's port. |
| 56 | config.vm.network :forwarded_port, guest: 5000, host: 5000, auto_correct: true |
| 57 | end |