github.com/bhameyie/otto@v0.2.1-0.20160406174117-16052efa52ec/helper/compile/data/app/dev/Vagrantfile.tpl (about) 1 # Generated by Otto, do not edit! 2 # 3 # This is the Vagrantfile generated by Otto for the development of 4 # this application/service. It should not be hand-edited. To modify the 5 # Vagrantfile, use the Appfile. 6 7 Vagrant.configure("2") do |config| 8 {% block vagrant_box %} 9 if ENV["OTTO_VAGRANT_LAYER_PATH"] 10 config.vm.clone = ENV["OTTO_VAGRANT_LAYER_PATH"] 11 else 12 config.vm.box = "hashicorp/precise64" 13 config.vm.box_check_update = false 14 config.vm.provider :parallels do |p, o| 15 o.vm.box = "parallels/ubuntu-12.04" 16 end 17 end 18 {% endblock %} 19 20 # Host only network 21 config.vm.network "private_network", ip: "{{ dev_ip_address }}" 22 23 {% block default_shared_folder %} 24 # Setup a synced folder from our working directory to /vagrant 25 config.vm.synced_folder '{{ path.working }}', "/vagrant", 26 owner: "vagrant", group: "vagrant" 27 {% endblock %} 28 29 # Enable SSH agent forwarding so getting private dependencies works 30 config.ssh.forward_agent = true 31 32 # Foundation configuration (if any) 33 {% for dir in foundation_dirs.dev %} 34 dir = "/otto/foundation-{{ forloop.Counter }}" 35 config.vm.synced_folder '{{ dir }}', dir 36 config.vm.provision "shell", inline: "cd #{dir} && bash #{dir}/main.sh" 37 {% endfor %} 38 39 # ScriptPacks 40 dir = "/otto/scriptpacks" 41 config.vm.provision "shell", inline: "sudo rm -rf #{dir}; sudo mkdir -p #{dir}; sudo chmod 0777 #{dir}" 42 {% for sp in scriptpacks %} 43 config.vm.provision "file", source: '{{ sp.path }}', destination: "#{dir}/{{ sp.name }}.tar.gz" 44 config.vm.provision "shell", inline: "cd #{dir}; sudo mkdir {{ sp.name }}; sudo tar xzf {{ sp.name }}.tar.gz -C {{ sp.name }}" 45 {% endfor %} 46 47 # Load all our fragments here for any dependencies. 48 {% for fragment in dev_fragments %} 49 {{ fragment|read }} 50 {% endfor %} 51 52 # Use linked clones if possible 53 config.vm.provider "virtualbox" do |p| 54 p.linked_clone = true 55 end 56 57 if Vagrant.has_plugin?("vagrant-parallels", ">= 1.6.0") 58 config.vm.provider "parallels" do |p| 59 p.linked_clone = true 60 end 61 end 62 63 # This is to work around some bugs right now 64 ["vmware_fusion", "vmware_workstation"].each do |name| 65 config.vm.provider(name) do |p| 66 p.enable_vmrun_ip_lookup = false 67 end 68 end 69 70 {% block vagrant_config %}{% endblock %} 71 end 72 73 {% if dev_extra_vagrantfile and dev_extra_vagrantfile != "" %} 74 # Extra Vagrantfile specified in Appfile manually 75 load "{{ dev_extra_vagrantfile }}" 76 {% endif %} 77 78 {% block footer %}{% endblock %}