dockly 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
data/dockly.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = %w{lib}
16
16
  gem.version = Dockly::VERSION
17
17
  gem.add_dependency 'clamp', '~> 0.6'
18
- gem.add_dependency 'docker-api', '~> 1.8.0'
18
+ gem.add_dependency 'docker-api', '~> 1.8.3'
19
19
  gem.add_dependency 'dockly-util', '~> 0.0.7'
20
20
  gem.add_dependency 'excon'
21
21
  gem.add_dependency 'fog', '~> 1.18.0'
data/lib/dockly/docker.rb CHANGED
@@ -17,7 +17,7 @@ class Dockly::Docker
17
17
  dsl_class_attribute :registry, Dockly::Docker::Registry
18
18
 
19
19
  dsl_attribute :name, :import, :git_archive, :build, :tag, :build_dir, :package_dir,
20
- :timeout, :cleanup_images, :registry_import, :auth_config_file
20
+ :timeout, :cleanup_images, :auth_config_file
21
21
 
22
22
  default_value :tag, nil
23
23
  default_value :build_dir, 'build/docker'
@@ -34,7 +34,10 @@ class Dockly::Docker
34
34
  images[:one] = import_base(docker_tar)
35
35
  else
36
36
  registry.authenticate! unless registry.nil?
37
- images[:one] = ::Docker::Image.create('fromImage' => registry_import)
37
+ full_name = "#{registry_import[:name]}:#{registry_import[:tag]}"
38
+ info "Pulling #{full_name}"
39
+ images[:one] = ::Docker::Image.create('repo' => registry_import[:name], 'tag' => registry_import[:tag])
40
+ info "Successfully pulled #{full_name}"
38
41
  end
39
42
 
40
43
  images[:two] = add_git_archive(images[:one])
@@ -48,6 +51,16 @@ class Dockly::Docker
48
51
  cleanup(images.values.compact) if cleanup_images
49
52
  end
50
53
 
54
+ def registry_import(img_name = nil, opts = {})
55
+ if img_name
56
+ @registry_import ||= {}
57
+ @registry_import[:name] = img_name
58
+ @registry_import[:tag] = opts[:tag] || 'latest'
59
+ else
60
+ @registry_import
61
+ end
62
+ end
63
+
51
64
  def cleanup(images)
52
65
  ::Docker::Container.all(:all => true).each do |container|
53
66
  image_id = container.json['Image']
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '1.4.3'
2
+ VERSION = '1.4.4'
3
3
  end
@@ -213,7 +213,7 @@ describe Dockly::Docker do
213
213
  context 'when there is a registry' do
214
214
  subject {
215
215
  Dockly::Docker.new do
216
- registry_import 'nahiluhmot/base'
216
+ registry_import 'nahiluhmot/base', :tag => 'latest'
217
217
  git_archive '.'
218
218
  build "run touch /it_worked"
219
219
  repository 'dockly_test'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-20 00:00:00.000000000 Z
12
+ date: 2014-02-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: 1.8.0
37
+ version: 1.8.3
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: 1.8.0
45
+ version: 1.8.3
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: dockly-util
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -338,3 +338,4 @@ test_files:
338
338
  - spec/fixtures/test-2.tar.gz
339
339
  - spec/spec_helper.rb
340
340
  - spec/support/vcr.rb
341
+ has_rdoc: