vocker 0.3.0 → 0.3.1

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: 44a844c870a820f565be23e2d3a34a949e5e60e3
4
- data.tar.gz: 42043288ffa6271f3072be1050551eafaf2f769c
3
+ metadata.gz: c85ef7c68884d8019894cc7d582743749470350b
4
+ data.tar.gz: 8afc3a12d801e8a57b6906cf2033b70bd5df232c
5
5
  SHA512:
6
- metadata.gz: 403e7e1b1e34b03daf10e6c98955954af31a9bf8ffc4f305361910d8501ac1589e2281c213839f5a9cbc3f89ffadc86cc244483e540fa84d2604f61fc8eb5f62
7
- data.tar.gz: b23c38a0b8b55f7277938e82b5d3aa19d2af3fcac36305eae3c8d3d46c89b0903aa6fc20b81c02288f6231725f7025776e887f198c2ebead2628d054bdf23e16
6
+ metadata.gz: 60c268d5a0c91851e414f6eda5c88a057169288a3f90d312836ad5fea4868ea7d19cd8655ac25db35646839babd6585e115303dfee6adec9c507e7c909110c8d
7
+ data.tar.gz: d8dda39a64b9b09e2ee38534ee36259516825413cb3b9810b010300efb7adc08f8a8c8bac0a4c342be6f7c9eed1a980e974b2c63a12ee8499733f29b377ce7aa
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.3.1](https://github.com/fgrehm/vocker/compare/v0.3.0...v0.3.1) (October 3, 2013)
2
+
3
+ - Check if container is running before trying to restart
4
+ - Configure automatic restart of containers regardless of Vagrant version
5
+
1
6
  ## [0.3.0](https://github.com/fgrehm/vocker/compare/v0.2.1...v0.3.0) (September 7, 2013)
2
7
 
3
8
  - Add support for Docker's `-dns` parameter
data/Gemfile.lock CHANGED
@@ -13,7 +13,7 @@ GIT
13
13
  PATH
14
14
  remote: .
15
15
  specs:
16
- vocker (0.3.0)
16
+ vocker (0.3.1)
17
17
 
18
18
  GEM
19
19
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -26,8 +26,7 @@ vagrant plugin install vocker
26
26
 
27
27
  ## Status
28
28
 
29
- Early development. It can be useful for trying out Docker and it's growing "ecossystem"
30
- but the feature set and configuration format might change rapidly.
29
+ Early development. It can be useful for trying out Docker and its growing "ecosystem" but the feature set and configuration format might change rapidly.
31
30
 
32
31
  Apart from that I've only used the plugin on the following Ubuntu 13.04 VMs:
33
32
 
@@ -40,8 +39,7 @@ containers you need some extra steps described below_
40
39
 
41
40
  ## Usage
42
41
 
43
- Currently Vocker can be used in three different ways: as a provisioner, as a command
44
- and as a foundation for other Vagrant plugins.
42
+ Currently Vocker can be used in three different ways: as a provisioner, as a command and as a foundation for other Vagrant plugins.
45
43
 
46
44
  ### Provisioner
47
45
 
@@ -46,7 +46,13 @@ module VagrantPlugins
46
46
  end
47
47
 
48
48
  def start_container(id)
49
- @machine.communicate.sudo("docker start #{id}")
49
+ unless container_running?(id)
50
+ @machine.communicate.sudo("docker start #{id}")
51
+ end
52
+ end
53
+
54
+ def container_running?(id)
55
+ @machine.communicate.test("sudo docker ps -q | grep #{id}")
50
56
  end
51
57
 
52
58
  def create_container(config)
@@ -25,8 +25,10 @@ module VagrantPlugins
25
25
  end
26
26
  end
27
27
 
28
- if Gem::Version.new(Vagrant::VERSION) >= Gem::Version.new('1.3.0')
28
+ if @machine.guest.capability?(:docker_configure_auto_start)
29
29
  @machine.guest.capability(:docker_configure_auto_start)
30
+ else
31
+ @machine.env.ui.warn I18n.t('vagrant.docker_auto_start_not_available')
30
32
  end
31
33
  end
32
34
  end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Vocker
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -6,3 +6,6 @@ en:
6
6
  Pulling Docker images...
7
7
  docker_starting_containers:
8
8
  Starting Docker containers...
9
+ docker_auto_start_not_available: |-
10
+ Unable to configure automatic restart of Docker containers on
11
+ the guest machine
@@ -58,13 +58,20 @@ describe VagrantPlugins::Vocker::DockerClient do
58
58
 
59
59
  context 'when the container already exists' do
60
60
  before do
61
- stub(communicator).test(with{|cmd| cmd =~ /docker ps/}) { true }
62
- subject.run containers
61
+ stub(communicator).test(with{|cmd| cmd =~ /docker ps -a -q/}) { true }
63
62
  end
64
63
 
65
- it 'starts the container' do
64
+ it 'starts the container if it is stopped' do
65
+ stub(communicator).test(with{|cmd| cmd =~ /docker ps -q/}) { false }
66
+ subject.run containers
66
67
  expect(communicator).to have_received.sudo(with{|cmd| cmd =~ /docker start/})
67
68
  end
69
+
70
+ it 'noops if container is already running' do
71
+ stub(communicator).test(with{|cmd| cmd =~ /docker ps -q/}) { true }
72
+ subject.run containers
73
+ expect(communicator).to_not have_received.sudo(with{|cmd| cmd =~ /docker start/})
74
+ end
68
75
  end
69
76
 
70
77
  context 'when the container does not exist' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vocker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-07 00:00:00.000000000 Z
11
+ date: 2013-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler