docker-shaball 0.1.0 → 0.1.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: 817611bc9747f865a69fbc22223f9e13e23a4610
4
- data.tar.gz: ec21c7c41e8d09f4542935af256edda0c409ae65
3
+ metadata.gz: efbb7a3444628460b40193c085ff5fd5e8fc39bd
4
+ data.tar.gz: d116594e8a79c88892f45c4eb4faec62774c5733
5
5
  SHA512:
6
- metadata.gz: fb41f0da700abc36f78640936ab89f6a3cede281236921893ed0798087ea0c3b659ea01ad7c039657ac9783280b84d0ad74febc14fe4b226f94bd7dd5762f6d5
7
- data.tar.gz: 89b08918652b51a2f5ef5b2a5148bc044a079c10de7ace5b524236bc48be943db930a0d694b5db72478239c5ad98a2096b48f00b66ad0142014db06cff940d89
6
+ metadata.gz: 2df782b032af84e7db43269371cd37d79d2fd6d495c94acc911dbed82d00a73c2eef0c8e269e56d14c56c6f834487b00bb24ef27e70d934c3c13ba601e5a75e0
7
+ data.tar.gz: 167623a824fc1071f5c7bfbee8ac90d2e543b39cdd2d5d6d10b631cd88146a05f2e59fbf8600540cb0ae8371d12570f649466fc1f0713b77a50c7a10f66bd783
data/bin/docker-shaball CHANGED
@@ -26,16 +26,25 @@ Clamp do
26
26
  end
27
27
  manifest_checksum = Digest::SHA1.hexdigest(image_manifest)
28
28
  output_file_name = "#{manifest_checksum}.tar.gz"
29
- system("set -o pipefail; docker save #{image_names.join(' ')} | gzip > #{output_file_name}")
30
- if $?.success?
31
- puts output_file_name
32
- else
33
- signal_error("docker save failed")
34
- end
29
+
30
+ save_images(image_names, output_file_name)
31
+ puts output_file_name
35
32
  end
36
33
 
37
34
  private
38
35
 
36
+ def save_images(image_names, output_file_name)
37
+ r,w = IO.pipe
38
+ save = spawn("docker save #{image_names.join(' ')}", out: w)
39
+ gzip = spawn("gzip", in: r, out: [output_file_name, 'w'])
40
+ r.close
41
+ w.close
42
+ Process.wait save
43
+ signal_error("docker save failed") unless $?.success?
44
+ Process.wait gzip
45
+ signal_error("gzip failed") unless $?.success?
46
+ end
47
+
39
48
  def image_names
40
49
  image_list.map do |name|
41
50
  name += ":latest" unless name.index(":")
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  Gem::Specification.new do |spec|
6
6
 
7
7
  spec.name = "docker-shaball"
8
- spec.version = "0.1.0"
8
+ spec.version = "0.1.1"
9
9
  spec.authors = ["Mike Williams", "Luke Carter-Key"]
10
10
  spec.email = ["mdub@dogbiscuit.org", "luke.carterkey@gmail.com"]
11
11
  spec.summary = %q{Create a tar-ball containing some Docker images}
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.files = `git ls-files -z`.split("\x0")
16
16
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
17
 
18
- spec.add_runtime_dependency "clamp", "~> 0.6.4"
18
+ spec.add_runtime_dependency "clamp", ">= 0.6"
19
19
 
20
20
  spec.add_development_dependency "bundler", "~> 1.10"
21
21
  spec.add_development_dependency "rake", "~> 10.4"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-shaball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Williams
@@ -9,22 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-06-02 00:00:00.000000000 Z
12
+ date: 2015-07-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: clamp
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 0.6.4
20
+ version: '0.6'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 0.6.4
27
+ version: '0.6'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: bundler
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
88
  version: '0'
89
89
  requirements: []
90
90
  rubyforge_project:
91
- rubygems_version: 2.4.5
91
+ rubygems_version: 2.4.8
92
92
  signing_key:
93
93
  specification_version: 4
94
94
  summary: Create a tar-ball containing some Docker images