forked from rgl/nexus-vagrant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
64 lines (58 loc) · 2.86 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# to make sure the nexus node is created before the other nodes, we
# have to force a --no-parallel execution.
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
nexus_domain = 'nexus.example.com'
nexus_ip = '192.168.56.3'
Vagrant.configure(2) do |config|
config.vm.provider :libvirt do |lv, config|
lv.memory = 2048
lv.cpus = 2
lv.cpu_mode = 'host-passthrough'
lv.keymap = 'pt'
end
config.vm.provider :virtualbox do |vb|
vb.linked_clone = true
vb.cpus = 2
vb.memory = 2048
end
config.vm.define :nexus do |config|
config.vm.box = 'ubuntu-18.04-amd64'
config.vm.hostname = nexus_domain
config.vm.network 'private_network', ip: nexus_ip
config.vm.provision :shell, path: 'provision/provision-base.sh'
config.vm.provision :shell, path: 'provision/provision-nexus.sh'
config.vm.provision :shell, path: 'provision/use-raw-repository.sh'
config.vm.provision :shell, path: 'provision/use-maven-repository-from-mvn.sh'
config.vm.provision :shell, path: 'provision/use-maven-repository-from-gradle.sh'
config.vm.provision :shell, path: 'provision/use-nuget-repository.sh'
config.vm.provision :shell, path: 'provision/use-npm-repository.sh'
config.vm.provision :shell, path: 'provision/summary.sh'
end
config.vm.define :windows do |config|
config.vm.box = 'windows-2016-amd64'
config.vm.network 'private_network', ip: '192.168.56.4'
# replace the default synced_folder with something that works in cygwin.
# NB for some reason, this does not work when placed in the base box Vagrantfile.
config.vm.provider :libvirt do |lv, config|
config.vm.synced_folder '.', '/vagrant', disabled: true
config.vm.synced_folder '.', '/cygdrive/c/vagrant', type: 'rsync', rsync__exclude: [
'.vagrant/',
'.git/',
'*.box']
end
config.vm.provider :virtualbox do |v, override|
v.customize ['modifyvm', :id, '--vram', 64]
v.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
end
config.vm.provision :shell, inline: "echo '#{nexus_ip} #{nexus_domain}' | Out-File -Encoding Ascii -Append c:/Windows/System32/drivers/etc/hosts"
config.vm.provision :shell, path: 'provision/windows/ps.ps1', args: ['provision-base.ps1', nexus_domain]
config.vm.provision :shell, path: 'provision/windows/ps.ps1', args: ['use-chocolatey-repository.ps1', nexus_domain]
config.vm.provision :shell, path: 'provision/windows/ps.ps1', args: ['use-powershell-repository.ps1', nexus_domain]
config.vm.provision :shell, path: 'provision/windows/ps.ps1', args: ['use-npm-repository.ps1', nexus_domain]
end
config.trigger.before :up do |trigger|
trigger.only_on = 'nexus'
ldap_ca_cert_path = '../windows-domain-controller-vagrant/tmp/ExampleEnterpriseRootCA.der'
trigger.run = {inline: "sh -c 'mkdir -p shared && cp #{ldap_ca_cert_path} shared'"} if File.file? ldap_ca_cert_path
end
end