docker-spec 0.10.0 → 0.11.0

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: bd0de013abc784de7d90f58a914dc3c7c1664d61
4
- data.tar.gz: 8050f9d33b26ff81a533bed3b57c55cbef192809
3
+ metadata.gz: 7a3856ad41980d720cbfffc99157f1e87520265d
4
+ data.tar.gz: cdcc2657a028eb1cd7ddbcd795964f17194695a0
5
5
  SHA512:
6
- metadata.gz: a928acf4dc6dd841aa19bf7e95859d2e0b017c0b728b921f5218f8b877d8e65e55c79c21d6a8e22d19af149a33b0523473dd5b323d650b4cc8e38f5c3672bbd2
7
- data.tar.gz: a81bdd7dd3a59761ebb441c95c2ca3c6e8257fefb50583860a1fc68a0eaef950461c5205d5361da1de40fa55950da50a8feae62cdbc5432c09bb2dfccf7e71f8
6
+ metadata.gz: f081358fa6a6db4f470edb731f0490d061cc9d11b0fb711806168f3e5a72e68e9921ec4ab7cd770fad7785e1685c492056453c402d1bb12721a48757ab22878e
7
+ data.tar.gz: a7c7d8333780c2d9afd8d7fccbc6370eb4cf0b21ad0a44bafb2d0115507e9feeefa6010f08100d5e87481f5b6d09f36b3dc3c7246572f803ff5f03ad418bcaa0
@@ -5,13 +5,6 @@ module Docker
5
5
  before(:all) do
6
6
  @container = DockerSpec.instance.container
7
7
  @image = @container.info["Image"]
8
- @config = DockerSpec.instance.config
9
- @lock = File.join('/tmp', @config[:account] + '-' + @config[:name] + '.lock')
10
- @f = File.open(@lock, 'w')
11
- if (not @f.flock(File::LOCK_EX | File::LOCK_NB))
12
- puts "INFO: Another build is already running"
13
- end
14
- @f.flock(File::LOCK_EX)
15
8
  end
16
9
 
17
10
  it 'should be available' do
@@ -1,5 +1,5 @@
1
1
  module Docker
2
2
  module Spec
3
- VERSION = "0.10.0"
3
+ VERSION = "0.11.0"
4
4
  end
5
5
  end
data/lib/docker/spec.rb CHANGED
@@ -31,11 +31,22 @@ class DockerSpec
31
31
  @test_failed = false
32
32
 
33
33
  load_config
34
+ flock
34
35
  build_root if @config[:build_root]
35
36
  build_docker_image if @config[:build_image]
36
37
  rspec_configure
37
38
  end
38
39
 
40
+ def flock
41
+ @config = DockerSpec.instance.config
42
+ @lock = File.join('/tmp', @config[:account] + '-' + @config[:name] + '.lock')
43
+ @f = File.open(@lock, 'w')
44
+ if (not @f.flock(File::LOCK_EX | File::LOCK_NB))
45
+ puts "INFO: Another build is already running"
46
+ end
47
+ @f.flock(File::LOCK_EX)
48
+ end
49
+
39
50
  def push
40
51
  @config[:push_container] = get_config(:push_container, 'DOCKER_SPEC_PUSH_CONTAINER',
41
52
  'Push new tag? ')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Breinlinger