vagrant-compose-yaml 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/vagrant-compose-yaml/command.rb +22 -2
- data/lib/vagrant-compose-yaml/version.rb +1 -1
- data/templates/Vagrantfile.erb +4 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cddd3b1850ab03d4c493ef24b1f9a960ef334dcc
|
4
|
+
data.tar.gz: b54da77a93d2d4a01d33eb4ce0435a54f516bd46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d02fe94b6c748276a8980d1c3d5e5a97fe9a20920a81315acb3e87b01fb609516260cd500d7359a1ed17bbc299f99e3206454a9e6d7b337dc7862b4c1cf62ed
|
7
|
+
data.tar.gz: ae056d157800f7e02e70f885d6531c4c9a0e549f9254e960e3ca192034b54da1269e067952aaa54c740a425e9f6ce7f7ef51dacaabd46c7705646499af389dc5
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ IMPROVEMENTS:
|
|
4
4
|
|
5
5
|
- Defining and running multi-machine Vagrant environment without Vagrantfile.
|
6
6
|
|
7
|
+
## 0.1.3 (September 16, 2016)
|
8
|
+
|
9
|
+
FEATURES:
|
10
|
+
|
11
|
+
- Add support for connection directly by using the hostname.
|
12
|
+
|
7
13
|
## 0.1.2 (September 14, 2016)
|
8
14
|
|
9
15
|
FEATURES:
|
@@ -63,7 +63,16 @@ module VagrantPlugins
|
|
63
63
|
|
64
64
|
def yaml2vagrantdata(yaml_path)
|
65
65
|
yaml = YAML.load_file(yaml_path)
|
66
|
-
yaml['services']
|
66
|
+
add_basic_parameters(yaml['services'])
|
67
|
+
add_links(yaml['services'])
|
68
|
+
yaml
|
69
|
+
end
|
70
|
+
|
71
|
+
def add_basic_parameters(services)
|
72
|
+
services.each_with_index do |(name, service), index|
|
73
|
+
if service['ip'] == nil
|
74
|
+
service['ip'] = "192.168.33.1#{index}"
|
75
|
+
end
|
67
76
|
if service['ports'] != nil
|
68
77
|
service['forwarded_port'] = Array.new
|
69
78
|
service['ports'].each do |port|
|
@@ -79,7 +88,18 @@ module VagrantPlugins
|
|
79
88
|
end
|
80
89
|
end
|
81
90
|
end
|
82
|
-
|
91
|
+
end
|
92
|
+
|
93
|
+
def add_links(services)
|
94
|
+
services.each_with_index do |(name, service), index|
|
95
|
+
service['links'] = Array.new
|
96
|
+
services.each_with_index do |(name2, service2), index2|
|
97
|
+
if index == index2
|
98
|
+
next
|
99
|
+
end
|
100
|
+
service['links'].push({'host' => name2, 'ip' => service2['ip']})
|
101
|
+
end
|
102
|
+
end
|
83
103
|
end
|
84
104
|
end
|
85
105
|
end
|
data/templates/Vagrantfile.erb
CHANGED
@@ -5,19 +5,17 @@ Vagrant.configure("2") do |config|
|
|
5
5
|
<%- services.each do |k, v| -%>
|
6
6
|
config.vm.define :<%= k %> do |c|
|
7
7
|
c.vm.box = "<%= v['box'] %>"
|
8
|
-
c.vm.synced_folder ".", "/vagrant", disabled: true
|
9
8
|
<%- if v['url'] -%>
|
10
9
|
c.vm.box_url = "<%= v['url'] %>"
|
11
10
|
<%- end -%>
|
12
11
|
c.vm.hostname = "<%= k %>"
|
13
|
-
<%- if v['ip'] -%>
|
14
12
|
c.vm.network "private_network", ip: "<%= v['ip'] %>"
|
15
|
-
<%- end -%>
|
16
13
|
<%- if v['forwarded_port'] -%>
|
17
14
|
<%- v['forwarded_port'].each do |port| -%>
|
18
15
|
c.vm.network "forwarded_port", guest: <%= port['guest'] %>, host: <%= port['host'] %>
|
19
16
|
<%- end -%>
|
20
17
|
<%- end -%>
|
18
|
+
c.vm.synced_folder ".", "/vagrant", disabled: true
|
21
19
|
<%- if v['synced_folder'] -%>
|
22
20
|
<%- v['synced_folder'].each do |volume| -%>
|
23
21
|
c.vm.synced_folder "<%= volume['host'] %>", "<%= volume['guest'] %>"
|
@@ -28,6 +26,9 @@ Vagrant.configure("2") do |config|
|
|
28
26
|
vb.customize ["modifyvm", :id, "--memory", "<%= v['memory'] %>"]
|
29
27
|
end
|
30
28
|
<%- end -%>
|
29
|
+
<%- if v['links'] -%>
|
30
|
+
c.vm.provision "shell", inline: "<%- v['links'].each do |link| -%>echo '<%= link['ip'] %> <%= link['host'] %>' >> /etc/hosts;<%- end -%>"
|
31
|
+
<%- end -%>
|
31
32
|
end
|
32
33
|
<%- end -%>
|
33
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-compose-yaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- innossh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Sets up your working directory to be a Vagrant-managed multi-machine
|
14
14
|
environment by YAML.
|