]> git.openstreetmap.org Git - nominatim.git/blob - Vagrantfile
use NominatimAPI in with context in CLI tool
[nominatim.git] / Vagrantfile
1 # -*- mode: ruby -*-
2 # vi: set ft=ruby :
3
4 Vagrant.configure("2") do |config|
5   # Apache webserver
6   config.vm.network "forwarded_port", guest: 80, host: 8089
7   config.vm.network "forwarded_port", guest: 8088, host: 8088
8
9   # If true, then any SSH connections made will enable agent forwarding.
10   config.ssh.forward_agent = true
11
12   # Never sync the current directory to /vagrant.
13   config.vm.synced_folder ".", "/vagrant", disabled: true
14
15   checkout = "yes"
16   if ENV['CHECKOUT'] != 'y' then
17     checkout = "no"
18   end
19
20   config.vm.provider "hyperv" do |hv, override|
21     hv.memory = 2048
22     hv.linked_clone = true
23     if ENV['CHECKOUT'] != 'y' then
24       override.vm.synced_folder ".", "/home/vagrant/Nominatim", type: "smb", smb_host: ENV['SMB_HOST'] || ENV['COMPUTERNAME']
25     end
26   end
27
28   config.vm.provider "virtualbox" do |vb, override|
29     vb.gui = false
30     vb.memory = 2048
31     vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant","0"]
32     if ENV['CHECKOUT'] != 'y' then
33       override.vm.synced_folder ".", "/home/vagrant/Nominatim"
34     end
35   end
36
37   config.vm.provider "parallels" do |prl, override|
38     prl.update_guest_tools = false
39     prl.memory = 2048
40     if ENV['CHECKOUT'] != 'y' then
41       override.vm.synced_folder ".", "/home/vagrant/Nominatim"
42     end
43   end
44
45   config.vm.provider "libvirt" do |lv, override|
46     lv.memory = 2048
47     lv.nested = true
48     if ENV['CHECKOUT'] != 'y' then
49       override.vm.synced_folder ".", "/home/vagrant/Nominatim", type: 'nfs', nfs_udp: false
50     end
51   end
52
53   config.vm.define "ubuntu22", primary: true do |sub|
54       sub.vm.box = "generic/ubuntu2204"
55       sub.vm.provision :shell do |s|
56         s.path = "vagrant/Install-on-Ubuntu-22.sh"
57         s.privileged = false
58         s.args = [checkout]
59       end
60   end
61
62   config.vm.define "ubuntu22-apache" do |sub|
63       sub.vm.box = "generic/ubuntu2204"
64       sub.vm.provision :shell do |s|
65         s.path = "vagrant/Install-on-Ubuntu-22.sh"
66         s.privileged = false
67         s.args = [checkout, "install-apache"]
68       end
69   end
70
71   config.vm.define "ubuntu22-nginx" do |sub|
72       sub.vm.box = "generic/ubuntu2204"
73       sub.vm.provision :shell do |s|
74         s.path = "vagrant/Install-on-Ubuntu-22.sh"
75         s.privileged = false
76         s.args = [checkout, "install-nginx"]
77       end
78   end
79
80   config.vm.define "ubuntu24" do |sub|
81       sub.vm.box = "bento/ubuntu-24.04"
82       if RUBY_PLATFORM.include?('darwin') && RUBY_PLATFORM.include?('arm64')
83         # Apple M processor
84         sub.vm.box = 'gutehall/ubuntu24-04'
85       end
86       sub.vm.provision :shell do |s|
87         s.path = "vagrant/Install-on-Ubuntu-24.sh"
88         s.privileged = false
89         s.args = [checkout]
90       end
91   end
92
93   config.vm.define "ubuntu24-apache" do |sub|
94       sub.vm.box = "bento/ubuntu-24.04"
95       sub.vm.provision :shell do |s|
96         s.path = "vagrant/Install-on-Ubuntu-24.sh"
97         s.privileged = false
98         s.args = [checkout, "install-apache"]
99       end
100   end
101
102   config.vm.define "ubuntu24-nginx" do |sub|
103       sub.vm.box = "bento/ubuntu-24.04"
104       sub.vm.provision :shell do |s|
105         s.path = "vagrant/Install-on-Ubuntu-24.sh"
106         s.privileged = false
107         s.args = [checkout, "install-nginx"]
108       end
109   end
110 end