dockly 1.4.9 → 1.5.0

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.
@@ -25,12 +25,24 @@ class Dockly::BuildCache::Docker < Dockly::BuildCache::Base
25
25
  ensure_present! :output_dir
26
26
  if cache = pull_from_s3(version)
27
27
  debug "inserting to #{output_directory}"
28
- container = image.run("mkdir -p #{File.dirname(output_directory)}")
29
- image_with_dir = container.tap(&:wait).commit
30
- self.image = image_with_dir.insert_local(
31
- 'localPath' => cache.path,
32
- 'outputPath' => File.dirname(output_directory)
28
+ path = File.expand_path(cache.path)
29
+ path_parent = File.dirname(path)
30
+ container = ::Docker::Container.create(
31
+ 'Image' => image.id,
32
+ 'Cmd' => ['/bin/bash', '-lc', [
33
+ "mkdir -p #{File.dirname(output_directory)}",
34
+ '&&',
35
+ "tar -xf #{File.join('/', 'host', path)} -C #{File.dirname(output_directory)}"
36
+ ].join(' ')
37
+ ],
38
+ 'Volumes' => {
39
+ File.join('/', 'host', path_parent) => { path_parent => 'rw' }
40
+ }
33
41
  )
42
+ container.start('Binds' => ["#{path_parent}:#{File.join('/', 'host', path_parent)}"])
43
+ result = container.wait['StatusCode']
44
+ raise "Got bad status code when copying build cache: #{result}" unless result.zero?
45
+ self.image = container.commit
34
46
  debug "inserted cache into #{output_directory}"
35
47
  cache.close
36
48
  else
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '1.4.9'
2
+ VERSION = '1.5.0'
3
3
  end
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.9
4
+ version: 1.5.0
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-05 00:00:00.000000000 Z
12
+ date: 2014-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp