vagrant-docker-compose 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf8ba0c93bda9be46839f18d7cf5924d2577e395
4
- data.tar.gz: 8401fba5f9a5ac7610bb2113813d707d06e61439
3
+ metadata.gz: 8d913fc6f78fc86bba2124d632ae3849eda30780
4
+ data.tar.gz: b0aaeed03cbbbcf11179e7cb2782196dfb374978
5
5
  SHA512:
6
- metadata.gz: 2b9af03300b64975dac1c44d987015ee609a37d88fc8b4f81cf941fa84f23c8fb07985980fd72b782a1116849631926ee89695154996f4490059d629817d71d3
7
- data.tar.gz: d35123277d106baa4baa87123c8113351ec421602b40326ae08a2105edfd6ec25c194a328bfd0da1caeff42930b9b52b98179a50d9c46fd558ed90f7783991a3
6
+ metadata.gz: 1e4f9714ce4d46b7d179b423ee4c186e11b8a66d4c50f4d66c14407acf9b4abfe743b3838df88bc7b3ac429e7f7b5b4f4bb11d4c61978bc6c3eb9bede0f5d5a4
7
+ data.tar.gz: 8e7186461ac9b06c284c3362240584b6161fb80c119f4732d713a8360c1c8935db9bd60a59ebb4fc4386f7347e5b6debe014b7df5f56af6d3015e17f779f43c8
@@ -3,10 +3,10 @@ module VagrantPlugins
3
3
  module Cap
4
4
  module Linux
5
5
  module DockerComposeInstall
6
- def self.docker_compose_install(machine)
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/1.2.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
9
- chmod +x /usr/local/bin/docker-compose")
8
+ comm.sudo("curl -L https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` > #{config.executable}
9
+ chmod +x #{config.executable}")
10
10
  end
11
11
  end
12
12
  end
@@ -3,9 +3,9 @@ module VagrantPlugins
3
3
  module Cap
4
4
  module Linux
5
5
  module DockerComposeInstalled
6
- def self.docker_compose_installed(machine)
6
+ def self.docker_compose_installed(machine, config)
7
7
  paths = [
8
- "/usr/local/bin/docker-compose"
8
+ config.executable
9
9
  ]
10
10
 
11
11
  paths.all? do |p|
@@ -1,12 +1,21 @@
1
1
  module VagrantPlugins
2
2
  module DockerComposeProvisioner
3
3
  class Config < Vagrant.plugin("2", :config)
4
- attr_accessor :yml, :rebuild
4
+ attr_accessor :yml, :rebuild, :executable
5
5
 
6
6
  def yml=(yml)
7
7
  raise DockerComposeError, :yml_must_be_absolute if !Pathname.new(yml).absolute?
8
8
  @yml = yml
9
9
  end
10
+
11
+ def initialize
12
+ @executable = UNSET_VALUE
13
+ end
14
+
15
+ def finalize!
16
+ @executable = "/usr/local/bin/docker-compose" if @executable == UNSET_VALUE
17
+ end
18
+
10
19
  end
11
20
  end
12
21
  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("docker-compose -f \"#{@config.yml}\" build") do |type, data|
14
+ comm.sudo("#{@config.executable} -f \"#{@config.yml}\" 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("docker-compose -f \"#{@config.yml}\" rm --force") do |type, data|
23
+ comm.sudo("#{@config.executable} -f \"#{@config.yml}\" rm --force") 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("docker-compose -f \"#{@config.yml}\" up -d") do |type, data|
32
+ comm.sudo("#{@config.executable} -f \"#{@config.yml}\" up -d") do |type, data|
33
33
  handle_comm(type, data)
34
34
  end
35
35
  end
@@ -1,18 +1,19 @@
1
1
  module VagrantPlugins
2
2
  module DockerComposeProvisioner
3
3
  class Installer
4
- def initialize(machine)
4
+ def initialize(machine, config)
5
5
  @machine = machine
6
+ @config = config
6
7
  end
7
8
 
8
9
  def ensure_installed
9
10
  @machine.ui.detail(I18n.t(:checking_installation))
10
11
 
11
- if !@machine.guest.capability(:docker_compose_installed)
12
+ if !@machine.guest.capability(:docker_compose_installed, @config)
12
13
  @machine.ui.detail(I18n.t(:installing))
13
- @machine.guest.capability(:docker_compose_install)
14
+ @machine.guest.capability(:docker_compose_install, @config)
14
15
 
15
- if !@machine.guest.capability(:docker_compose_installed)
16
+ if !@machine.guest.capability(:docker_compose_installed, @config)
16
17
  raise DockerComposeError, :install_failed
17
18
  end
18
19
  end
@@ -1,6 +1,7 @@
1
1
  en:
2
2
  errors:
3
3
  yml_must_be_absolute: Docker Compose YML path must be absolute!
4
+ install_failed: Docker Compose installation failed
4
5
  not_supported_on_guest: Not supported on the guest operating system
5
6
  checking_installation: Checking for Docker Compose installation...
6
7
  installing: Installing Docker Compose
@@ -8,7 +8,7 @@ module VagrantPlugins
8
8
  def initialize(machine, config, installer = nil, docker_compose = nil)
9
9
  super(machine, config)
10
10
 
11
- @installer = installer || Installer.new(@machine)
11
+ @installer = installer || Installer.new(@machine, @config)
12
12
  @docker_compose = docker_compose || DockerCompose.new(@machine, @config)
13
13
  end
14
14
 
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module DockerComposeProvisioner
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  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.1
4
+ version: 0.0.2
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-05-10 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Vagrant provisioner for docker compose.
14
14
  email: