vagrant-docker-compose 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +26 -3
- data/example/Vagrantfile +1 -1
- data/lib/vagrant-docker-compose/config.rb +11 -1
- data/lib/vagrant-docker-compose/docker_compose.rb +3 -3
- data/lib/vagrant-docker-compose/version.rb +1 -1
- 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: 3930486d1aca6411df319ba44bf95db974ee92a0
|
4
|
+
data.tar.gz: 5fc231c462804a9c894eac310df38a58efccbfe6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faa873b961027a58f5eefa22064d4ea4c35145b0be46a4dcd3f3dd12ee75606dc2dea6b13efd16aeb2d29f1e1fe8a1f69ef9ac02eadb7fdd4c99fdf2a32932ae
|
7
|
+
data.tar.gz: f20c1bbef3c16f41aebe8417ce72774cc3b75b354731b18a175662b1a6aa6827887a57655ee4f16c01567d2c301e2a8a9713efe2b44cbf98cfc9fd27087f21e9
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ end
|
|
35
35
|
Equivalent to running:
|
36
36
|
|
37
37
|
```bash
|
38
|
-
docker-compose -f [yml] up
|
38
|
+
docker-compose -f [yml] up -d
|
39
39
|
```
|
40
40
|
|
41
41
|
### To install, rebuild and run docker-compose on `vagrant up`
|
@@ -52,16 +52,39 @@ end
|
|
52
52
|
Equivalent to running:
|
53
53
|
|
54
54
|
```bash
|
55
|
-
docker-compose -f [yml] rm
|
55
|
+
docker-compose -f [yml] rm --force
|
56
56
|
docker-compose -f [yml] build
|
57
|
-
docker-compose -f [yml] up
|
57
|
+
docker-compose -f [yml] up -d
|
58
58
|
```
|
59
59
|
|
60
|
+
### To install, rebuild and run docker-compose with options on `vagrant up`
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
Vagrant.configure("2") do |config|
|
64
|
+
config.vm.box = "ubuntu/trusty64"
|
65
|
+
|
66
|
+
config.vm.provision :docker
|
67
|
+
config.vm.provision :docker_compose, yml: "/vagrant/docker-compose.yml", rebuild: true,
|
68
|
+
options: "--x-networking", command_options: { rm: "", up: "-d --timeout 20"}, run: "always"
|
69
|
+
end
|
70
|
+
```
|
71
|
+
|
72
|
+
Equivalent to running:
|
73
|
+
|
74
|
+
```bash
|
75
|
+
docker-compose --x-networking -f [yml] rm
|
76
|
+
docker-compose --x-networking -f [yml] build
|
77
|
+
docker-compose --x-networking -f [yml] up -d --timeout 20
|
78
|
+
```
|
79
|
+
|
80
|
+
|
60
81
|
### Other configs
|
61
82
|
|
62
83
|
* `compose_version` – defaults to `1.5.0`.
|
63
84
|
* `project_name` – compose will default to naming the project `vagrant`.
|
64
85
|
* `executable` – the location the executable will be stored, defaults to `/usr/local/bin/docker-compose`.
|
86
|
+
* `options` - a `String` that's included as the first arguments when calling the docker-compose executable, you can use this to pass arbitrary options/flags to docker-compose, default to `nil`.
|
87
|
+
* `command_options` - a `Hash` of docker-compose commands to options, you can use this to pass arbitrary options/flags to the docker-compose commands, defaults to: `{ rm: "--force", up: "-d" }`.
|
65
88
|
|
66
89
|
## Example
|
67
90
|
|
data/example/Vagrantfile
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
module VagrantPlugins
|
2
2
|
module DockerComposeProvisioner
|
3
3
|
class Config < Vagrant.plugin("2", :config)
|
4
|
-
|
4
|
+
DEFAULT_COMMAND_OPTIONS = {
|
5
|
+
rm: "--force",
|
6
|
+
up: "-d"
|
7
|
+
}
|
8
|
+
|
9
|
+
attr_accessor :yml, :rebuild, :project_name, :executable, :compose_version, :options, :command_options
|
5
10
|
|
6
11
|
def yml=(yml)
|
7
12
|
raise DockerComposeError, :yml_must_be_absolute if !Pathname.new(yml).absolute?
|
@@ -12,12 +17,17 @@ module VagrantPlugins
|
|
12
17
|
@executable = UNSET_VALUE
|
13
18
|
@project_name = UNSET_VALUE
|
14
19
|
@compose_version = UNSET_VALUE
|
20
|
+
@options = UNSET_VALUE
|
21
|
+
@command_options = UNSET_VALUE
|
15
22
|
end
|
16
23
|
|
17
24
|
def finalize!
|
18
25
|
@executable = "/usr/local/bin/docker-compose" if @executable == UNSET_VALUE
|
19
26
|
@project_name = nil if @project_name == UNSET_VALUE
|
20
27
|
@compose_version = "1.5.0" if @compose_version == UNSET_VALUE
|
28
|
+
@options = nil if @options == UNSET_VALUE
|
29
|
+
@command_options = {} if @command_options == UNSET_VALUE
|
30
|
+
@command_options = DEFAULT_COMMAND_OPTIONS.merge(@command_options)
|
21
31
|
end
|
22
32
|
end
|
23
33
|
end
|
@@ -11,7 +11,7 @@ module VagrantPlugins
|
|
11
11
|
def build
|
12
12
|
@machine.ui.detail(I18n.t(:docker_compose_build))
|
13
13
|
@machine.communicate.tap do |comm|
|
14
|
-
comm.sudo("#{@config.executable} -f \"#{@config.yml}\" build") do |type, data|
|
14
|
+
comm.sudo("#{@config.executable} #{@config.options} -f \"#{@config.yml}\" build #{@config.command_options[:build]}") do |type, data|
|
15
15
|
handle_comm(type, data)
|
16
16
|
end
|
17
17
|
end
|
@@ -20,7 +20,7 @@ module VagrantPlugins
|
|
20
20
|
def rm
|
21
21
|
@machine.ui.detail(I18n.t(:docker_compose_rm))
|
22
22
|
@machine.communicate.tap do |comm|
|
23
|
-
comm.sudo("#{@config.executable} -f \"#{@config.yml}\" rm
|
23
|
+
comm.sudo("#{@config.executable} #{@config.options} -f \"#{@config.yml}\" rm #{@config.command_options[:rm]}") do |type, data|
|
24
24
|
handle_comm(type, data)
|
25
25
|
end
|
26
26
|
end
|
@@ -29,7 +29,7 @@ module VagrantPlugins
|
|
29
29
|
def up
|
30
30
|
@machine.ui.detail(I18n.t(:docker_compose_up))
|
31
31
|
@machine.communicate.tap do |comm|
|
32
|
-
comm.sudo("#{@config.executable} -f \"#{@config.yml}\" up
|
32
|
+
comm.sudo("#{@config.executable} #{@config.options} -f \"#{@config.yml}\" up #{@config.command_options[:up]}") do |type, data|
|
33
33
|
handle_comm(type, data)
|
34
34
|
end
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-docker-compose
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leigh McCulloch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Vagrant provisioner for docker compose.
|
14
14
|
email:
|