dockly 1.4.5 → 1.4.6

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.
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Dockly::VERSION
17
17
  gem.add_dependency 'clamp', '~> 0.6'
18
18
  gem.add_dependency 'docker-api', '~> 1.8.4'
19
- gem.add_dependency 'dockly-util', '~> 0.0.7'
19
+ gem.add_dependency 'dockly-util', '~> 0.0.8'
20
20
  gem.add_dependency 'excon'
21
21
  gem.add_dependency 'fog', '~> 1.18.0'
22
22
  gem.add_dependency 'foreman'
@@ -10,7 +10,7 @@ module Dockly::BuildCache
10
10
  attr_writer :model
11
11
 
12
12
  def model
13
- @mode ||= Dockly::BuildCache::Docker
13
+ @model ||= Dockly::BuildCache::Docker
14
14
  end
15
15
  end
16
16
  end
@@ -62,6 +62,7 @@ class Dockly::Docker
62
62
  end
63
63
 
64
64
  def cleanup(images)
65
+ info 'Cleaning up intermediate images'
65
66
  ::Docker::Container.all(:all => true).each do |container|
66
67
  image_id = container.json['Image']
67
68
  if images.any? { |image| image.id.start_with?(image_id) || image_id.start_with?(image.id) }
@@ -70,6 +71,7 @@ class Dockly::Docker
70
71
  end
71
72
  end
72
73
  images.each { |image| image.remove rescue nil }
74
+ info 'Done cleaning images'
73
75
  end
74
76
 
75
77
  def export_filename
@@ -113,6 +115,7 @@ class Dockly::Docker
113
115
  Grit::Git.with_timeout(120) do
114
116
  Dockly::Util::Git.git_repo.archive_to_file(Dockly::Util::Git.git_sha, prefix, git_archive_path, 'tar', 'cat')
115
117
  end
118
+ info "made the git archive for sha #{Dockly::Util::Git.git_sha}"
116
119
  git_archive_path
117
120
  end
118
121
 
@@ -131,26 +134,27 @@ class Dockly::Docker
131
134
  def import_base(docker_tar)
132
135
  info "importing the docker image from #{docker_tar}"
133
136
  image = ::Docker::Image.import(docker_tar)
134
- info "imported docker image: #{image.id}"
137
+ info "imported initial docker image: #{image.id}"
135
138
  image
136
139
  end
137
140
 
138
141
  def add_git_archive(image)
139
142
  return image if git_archive.nil?
140
-
141
- image.insert_local(
143
+ info "adding the git archive"
144
+ new_image = image.insert_local(
142
145
  'localPath' => git_archive_tar,
143
146
  'outputPath' => '/'
144
147
  )
148
+ info "successfully added the git archive"
149
+ new_image
145
150
  end
146
151
 
147
152
  def build_image(image)
148
153
  ensure_present! :name, :build
149
- info "starting build from #{image.id}"
154
+ info "running custom build steps, starting with id: #{image.id}"
150
155
  out_image = ::Docker::Image.build("from #{image.id}\n#{build}")
151
- info "built the image: #{out_image.id}"
152
- out_image.tag(:repo => repo, :tag => tag)
153
- out_image
156
+ info "finished running custom build steps, result id: #{out_image.id}"
157
+ out_image.tap { |img| img.tag(:repo => repo, :tag => tag) }
154
158
  end
155
159
 
156
160
  def repo
@@ -168,6 +172,7 @@ class Dockly::Docker
168
172
  ensure_present! :name
169
173
  if registry.nil?
170
174
  ensure_present! :build_dir
175
+ info "Exporting the image with id #{image.id} to file #{File.expand_path(tar_path)}"
171
176
  container = ::Docker::Container.create('Image' => image.id, 'Cmd' => %w[true])
172
177
  info "created the container: #{container.id}"
173
178
  Zlib::GzipWriter.open(tar_path) do |file|
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '1.4.5'
2
+ VERSION = '1.4.6'
3
3
  end
@@ -151,12 +151,11 @@ describe Dockly::BuildCache::Docker, :docker do
151
151
  before do
152
152
  build_cache.parameter_command command
153
153
  end
154
- let(:output) { "3.12.9-2-ARCH" }
155
154
 
156
155
  context "when parameter command returns successfully" do
157
156
  let(:command) { "uname -r" }
158
157
  it 'returns the output of the parameter_command' do
159
- expect(build_cache.parameter_output(command)).to eq(output)
158
+ expect(build_cache.parameter_output(command)).to match(/\A3\.\d{2}\.\d-\d-ARCH\Z/)
160
159
  end
161
160
  end
162
161
 
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.5
4
+ version: 1.4.6
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-03-03 00:00:00.000000000 Z
12
+ date: 2014-03-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: 0.0.7
53
+ version: 0.0.8
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: 0.0.7
61
+ version: 0.0.8
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: excon
64
64
  requirement: !ruby/object:Gem::Requirement