vagrant-docker-compose 0.0.10 → 1.0.0
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 +3 -2
- data/lib/vagrant-docker-compose/cap/linux/docker_compose_install.rb +2 -2
- data/lib/vagrant-docker-compose/cap/linux/docker_compose_installed.rb +1 -1
- data/lib/vagrant-docker-compose/cap/linux/docker_compose_symlink.rb +16 -0
- data/lib/vagrant-docker-compose/config.rb +5 -3
- data/lib/vagrant-docker-compose/docker_compose.rb +3 -3
- data/lib/vagrant-docker-compose/installer.rb +4 -1
- data/lib/vagrant-docker-compose/locales/en.yml +2 -1
- data/lib/vagrant-docker-compose/plugin.rb +5 -0
- data/lib/vagrant-docker-compose/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cad20fa21be8f29efe766761fcb709b0cc0216ae
|
4
|
+
data.tar.gz: 309b813b4ac63e7922dc72b72af96b71eeeb6fab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e61c9cb012ea59722303795cb2b73a7970bdbde28332924da8720a387d0983d2c41cd9b240940a941b6501a5b3367c729fa7defa6a37b7cc384c3db42e01fda1
|
7
|
+
data.tar.gz: e61fe2302eef57e8aef3ee0e60710008799d06366b7dd1896c1eb0f8c155b92cb4b0cb2a56bf97f265d722b013013f319f67c0dbb011a7308d546c42c07390fa
|
data/README.md
CHANGED
@@ -104,9 +104,10 @@ docker-compose --x-networking -f [yml] up -d --timeout 20
|
|
104
104
|
### Other configs
|
105
105
|
|
106
106
|
* `yml` – one or more [Compose files](https://docs.docker.com/compose/compose-file/) (YAML), may be a `String` for a single file, or `Array` for multiple.
|
107
|
-
* `compose_version` – defaults to `1.
|
107
|
+
* `compose_version` – defaults to `1.6.2`.
|
108
108
|
* `project_name` – compose will default to naming the project `vagrant`.
|
109
|
-
* `
|
109
|
+
* `executable_symlink_path` – the location the executable will be symlinked to, defaults to `/usr/local/bin/docker-compose`.
|
110
|
+
* `executable_install_path` – the location the executable will be stored, defaults to `<executable_symlink_path>-<compose_version>`, i.e. `/usr/local/bin/docker-compose-1.5.0`.
|
110
111
|
* `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`.
|
111
112
|
* `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" }`.
|
112
113
|
|
@@ -5,8 +5,8 @@ module VagrantPlugins
|
|
5
5
|
module DockerComposeInstall
|
6
6
|
def self.docker_compose_install(machine, config)
|
7
7
|
machine.communicate.tap do |comm|
|
8
|
-
comm.sudo("curl -L https://github.com/docker/compose/releases/download/#{config.compose_version}/docker-compose-`uname -s`-`uname -m` > #{config.
|
9
|
-
|
8
|
+
comm.sudo("curl -L https://github.com/docker/compose/releases/download/#{config.compose_version}/docker-compose-`uname -s`-`uname -m` > #{config.executable_install_path}")
|
9
|
+
comm.sudo("chmod +x #{config.executable_install_path}")
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module VagrantPlugins
|
2
|
+
module DockerComposeProvisioner
|
3
|
+
module Cap
|
4
|
+
module Linux
|
5
|
+
module DockerComposeSymlink
|
6
|
+
def self.docker_compose_symlink(machine, config)
|
7
|
+
machine.communicate.tap do |comm|
|
8
|
+
comm.sudo("rm -f #{config.executable_symlink_path}")
|
9
|
+
comm.sudo("ln -s #{config.executable_install_path} #{config.executable_symlink_path}")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -6,7 +6,7 @@ module VagrantPlugins
|
|
6
6
|
up: "-d"
|
7
7
|
}
|
8
8
|
|
9
|
-
attr_accessor :yml, :rebuild, :project_name, :
|
9
|
+
attr_accessor :yml, :rebuild, :project_name, :executable_symlink_path, :executable_install_path, :compose_version, :options, :command_options
|
10
10
|
|
11
11
|
def yml=(yml)
|
12
12
|
files = yml.is_a?(Array) ? yml : [yml]
|
@@ -17,17 +17,19 @@ module VagrantPlugins
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def initialize
|
20
|
-
@executable = UNSET_VALUE
|
21
20
|
@project_name = UNSET_VALUE
|
22
21
|
@compose_version = UNSET_VALUE
|
22
|
+
@executable_symlink_path = UNSET_VALUE
|
23
|
+
@executable_install_path = UNSET_VALUE
|
23
24
|
@options = UNSET_VALUE
|
24
25
|
@command_options = UNSET_VALUE
|
25
26
|
end
|
26
27
|
|
27
28
|
def finalize!
|
28
|
-
@executable = "/usr/local/bin/docker-compose" if @executable == UNSET_VALUE
|
29
29
|
@project_name = nil if @project_name == UNSET_VALUE
|
30
30
|
@compose_version = "1.6.2" if @compose_version == UNSET_VALUE
|
31
|
+
@executable_symlink_path = "/usr/local/bin/docker-compose" if @executable_symlink_path == UNSET_VALUE
|
32
|
+
@executable_install_path = "#{@executable_symlink_path}-#{@compose_version}" if @executable_install_path == UNSET_VALUE
|
31
33
|
@options = nil if @options == UNSET_VALUE
|
32
34
|
@command_options = {} if @command_options == UNSET_VALUE
|
33
35
|
@command_options = DEFAULT_COMMAND_OPTIONS.merge(@command_options)
|
@@ -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.
|
14
|
+
comm.sudo("#{@config.executable_install_path} #{@config.options} #{cli_options_for_yml_file} 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.
|
23
|
+
comm.sudo("#{@config.executable_install_path} #{@config.options} #{cli_options_for_yml_file} 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.
|
32
|
+
comm.sudo("#{@config.executable_install_path} #{@config.options} #{cli_options_for_yml_file} up #{@config.command_options[:up]}") do |type, data|
|
33
33
|
handle_comm(type, data)
|
34
34
|
end
|
35
35
|
end
|
@@ -10,7 +10,7 @@ module VagrantPlugins
|
|
10
10
|
@machine.ui.detail(I18n.t(:checking_installation))
|
11
11
|
|
12
12
|
if !@machine.guest.capability(:docker_compose_installed, @config)
|
13
|
-
@machine.ui.detail(I18n.t(:installing))
|
13
|
+
@machine.ui.detail(I18n.t(:installing, version: @config.compose_version))
|
14
14
|
@machine.guest.capability(:docker_compose_install, @config)
|
15
15
|
|
16
16
|
if !@machine.guest.capability(:docker_compose_installed, @config)
|
@@ -18,6 +18,9 @@ module VagrantPlugins
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
@machine.ui.detail(I18n.t(:symlinking, version: @config.compose_version))
|
22
|
+
@machine.guest.capability(:docker_compose_symlink, @config)
|
23
|
+
|
21
24
|
@machine.guest.capability(:docker_compose_set_project_name, @config)
|
22
25
|
end
|
23
26
|
end
|
@@ -4,7 +4,8 @@ en:
|
|
4
4
|
install_failed: Docker Compose installation failed
|
5
5
|
not_supported_on_guest: Not supported on the guest operating system
|
6
6
|
checking_installation: Checking for Docker Compose installation...
|
7
|
-
installing: Installing Docker Compose
|
7
|
+
installing: Installing Docker Compose %{version}
|
8
|
+
symlinking: Symlinking Docker Compose %{version}
|
8
9
|
docker_compose_up: Running docker-compose up...
|
9
10
|
docker_compose_rm: Running docker-compose rm...
|
10
11
|
docker_compose_build: Running docker-compose build...
|
@@ -24,6 +24,11 @@ module VagrantPlugins
|
|
24
24
|
Cap::Linux::DockerComposeInstall
|
25
25
|
end
|
26
26
|
|
27
|
+
guest_capability("linux", "docker_compose_symlink") do
|
28
|
+
require_relative "cap/linux/docker_compose_symlink"
|
29
|
+
Cap::Linux::DockerComposeSymlink
|
30
|
+
end
|
31
|
+
|
27
32
|
guest_capability("linux", "docker_compose_set_project_name") do
|
28
33
|
require_relative "cap/linux/docker_compose_set_project_name"
|
29
34
|
Cap::Linux::DockerComposeSetProjectName
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leigh McCulloch
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/vagrant-docker-compose/cap/linux/docker_compose_install.rb
|
32
32
|
- lib/vagrant-docker-compose/cap/linux/docker_compose_installed.rb
|
33
33
|
- lib/vagrant-docker-compose/cap/linux/docker_compose_set_project_name.rb
|
34
|
+
- lib/vagrant-docker-compose/cap/linux/docker_compose_symlink.rb
|
34
35
|
- lib/vagrant-docker-compose/config.rb
|
35
36
|
- lib/vagrant-docker-compose/docker_compose.rb
|
36
37
|
- lib/vagrant-docker-compose/errors/docker_compose_error.rb
|