|
| 1 | +# -*- mode: ruby -*- |
| 2 | +# vi: set ft=ruby : |
| 3 | + |
| 4 | +# All Vagrant configuration is done below. The "2" in Vagrant.configure |
| 5 | +# configures the configuration version (we support older styles for |
| 6 | +# backwards compatibility). Please don't change it unless you know what |
| 7 | +# you're doing. |
| 8 | +Vagrant.configure(2) do |config| |
| 9 | + # The most common configuration options are documented and commented below. |
| 10 | + # For a complete reference, please see the online documentation at |
| 11 | + # https://docs.vagrantup.com. |
| 12 | + |
| 13 | + # Every Vagrant development environment requires a box. You can search for |
| 14 | + # boxes at https://atlas.hashicorp.com/search. |
| 15 | + config.vm.box = "ubuntu/precise64" |
| 16 | + config.vm.host_name = "buildvlc" |
| 17 | + |
| 18 | + config.vm.provider "virtualbox" do |v| |
| 19 | + v.memory = 2048 |
| 20 | + v.cpus = 4 |
| 21 | + end |
| 22 | + |
| 23 | + # Poorman's apt package caching. This accelerates repeated provisioning. |
| 24 | + # From https://gist.github.com/millisami/3798773 |
| 25 | + def local_cache(box_name) |
| 26 | + cache_dir = File.join(File.expand_path('~/.vagrant.d'), 'cache', 'apt', box_name) |
| 27 | + partial_dir = File.join(cache_dir, 'partial') |
| 28 | + FileUtils.mkdir_p(partial_dir) unless File.exists? partial_dir |
| 29 | + cache_dir |
| 30 | + end |
| 31 | + |
| 32 | + cache_dir = local_cache(config.vm.box) |
| 33 | + config.vm.synced_folder cache_dir, "/var/cache/apt/archives/" |
| 34 | + |
| 35 | + # config.vm.synced_folder "assets", "/vagrant/assets", owner: "www-data", group: "www-data" |
| 36 | + # |
| 37 | + # config.vm.network "forwarded_port", guest: 80, host: 8777 |
| 38 | + # |
| 39 | + config.vm.provision :shell, |
| 40 | + privileged: true, |
| 41 | + path: "vagrant.sh" |
| 42 | +end |
0 commit comments