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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 254585f0b464de97c3d138b60ef21b63fff9ed45
4
- data.tar.gz: 81883d4b6a972a2b6d7833c9793783c8019edb2e
3
+ metadata.gz: cad20fa21be8f29efe766761fcb709b0cc0216ae
4
+ data.tar.gz: 309b813b4ac63e7922dc72b72af96b71eeeb6fab
5
5
  SHA512:
6
- metadata.gz: 61c0d722cdaf596102f40dda174bc6264fc650c6475ab95f010dfaa55253a5f29e1e24a89b83eb47f860af2075a96271a5bc400792909ae1f3c42b06b3a522c4
7
- data.tar.gz: ed619049b0f6554e53179191202067c49a11f53cfecfc5022a20e82235f5c382ead638ebb49b70d8d89883bd8f68a012b09b87b175f4dd641ebe0e7fa4a1bfb3
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.5.0`.
107
+ * `compose_version` – defaults to `1.6.2`.
108
108
  * `project_name` – compose will default to naming the project `vagrant`.
109
- * `executable` – the location the executable will be stored, defaults to `/usr/local/bin/docker-compose`.
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.executable}
9
- chmod +x #{config.executable}")
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
@@ -5,7 +5,7 @@ module VagrantPlugins
5
5
  module DockerComposeInstalled
6
6
  def self.docker_compose_installed(machine, config)
7
7
  paths = [
8
- config.executable
8
+ config.executable_install_path
9
9
  ]
10
10
 
11
11
  paths.all? do |p|
@@ -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, :executable, :compose_version, :options, :command_options
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.executable} #{@config.options} #{cli_options_for_yml_file} build #{@config.command_options[:build]}") do |type, data|
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.executable} #{@config.options} #{cli_options_for_yml_file} rm #{@config.command_options[:rm]}") do |type, data|
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.executable} #{@config.options} #{cli_options_for_yml_file} up #{@config.command_options[:up]}") do |type, data|
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
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DockerComposeProvisioner
3
- VERSION = "0.0.10"
3
+ VERSION = "1.0.0"
4
4
  end
5
5
  end
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.10
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