forked from DevOpsTribe/congruit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
50 lines (38 loc) · 1.55 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
config.vm.box = "base"
config.vm.provision "shell",
inline: "yum -y install golang"
config.vm.provision "shell",
inline: "go build -o /usr/bin/congruit /vagrant/congruit.go"
config.vm.hostname = 'centos7'
config.vm.box = "geerlingguy/centos7"
if ENV['WORKPLACES_ENABLED']
config.vm.provision "shell",
inline: "yum install git -y && congruit -debug -stockroom-dir=/vagrant/stockroom/ -debug -gitrepo https://github.com/Congruit/example-stockroom.git -workplaces #{ENV['WORKPLACES_ENABLED']}"
config.vm.define 'Centos7' do |centos7|
end
end
$script = <<SCRIPT
pkill congruit || echo 'congruit is not running'
cd /vagrant
congruit -debug -friend -token foobar -debug -gitrepo https://github.com/Congruit/example-stockroom.git -ssl_cert /vagrant/insecure-domain.crt -ssl_key /vagrant/insecure-domain.key
SCRIPT
config.vm.define 'Docker01' do |docker01|
docker01.vm.network "private_network", ip: "192.168.50.4"
docker01.vm.hostname = 'docker01'
docker01.vm.provision "shell",
inline: $script
end
config.vm.define 'Docker02' do |docker02|
docker02.vm.network "private_network", ip: "192.168.50.5"
docker02.vm.hostname = 'docker02'
docker02.vm.provision "shell",
inline: $script
end
end