linecook-gem 0.7.19 → 0.7.20

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: 593c2c8a635fcb5e22cc06f021a728d9891fd820
4
- data.tar.gz: 2913f1728d7af49d7e20a1a2d7f485c547600010
3
+ metadata.gz: cffe2fbdae91964b5c3cb0f75ac10c11fdce9c07
4
+ data.tar.gz: cb9fc2c70f413702732092761d336ec5c7acfd3f
5
5
  SHA512:
6
- metadata.gz: ba3dc84325463e36c291cd4f93b2bab8ddfc4b120e907ffa23f8a4b74321be24d992b0e7977ef64589465ae066eb028102f60a257eb83b31f8bd779b6e824a72
7
- data.tar.gz: 360ec87a4328866503c303e3a65cd6860b8b7f969d71f2863bb8382b9395d1d49a69990f8810238d4545f11cee6d7e9b784b9859f93b9d427ef03c66490350ad
6
+ metadata.gz: c82d380feb7cf146fca8bacf2e9b1b8c506f7fb8cdc944df645b3c46e3b10872c6cab6f23742fc6fe3986cc1efc540298ce057094ab4d82b6ecba201d2f51ebf
7
+ data.tar.gz: 91d6123a5f823c8c15843cbfa6c5c6e93593b71340d3da5fd42d8dca705c0eb769ef3b0168cf0cd5d10b5a35e3241f6cfa951656398a7bed5ee62f0537828fc6
@@ -28,7 +28,7 @@ module Linecook
28
28
  FileUtils.mkdir_p(File.dirname(@image.path))
29
29
  container.stop
30
30
  with_retries(5) do
31
- status = system("docker export #{@image.id} | xz -T 0 -0 > #{@image.path}")
31
+ system("/bin/bash -c 'docker export #{@image.id} | xz -T 0 -0 > #{@image.path}; exit $((${PIPESTATUS[0]} | ${PIPESTATUS[1]}))'")
32
32
  fail "Export failed" unless status
33
33
  end
34
34
  end
@@ -40,6 +40,7 @@ module Linecook
40
40
  'umount /dev/{{ user `ebs_device` }}1',
41
41
  'mkfs.ext4 /dev/{{ user `ebs_device` }}1',
42
42
  'tune2fs -L cloudimg-rootfs /dev/{{ user `ebs_device` }}1',
43
+ 'mkdir -p /mnt/packer-amazon-chroot-volumes/{{ user `ebs_device` }}',
43
44
  'mount /dev/{{ user `ebs_device` }}1 /mnt/packer-amazon-chroot-volumes/{{ user `ebs_device` }}',
44
45
  'tar -C /mnt/packer-amazon-chroot-volumes/{{ user `ebs_device` }} -xpf {{ user `source_image_path` }}',
45
46
  'cp /etc/resolv.conf /mnt/packer-amazon-chroot-volumes/{{ user `ebs_device` }}/etc',
@@ -2,7 +2,7 @@ def with_retries(retries, sleep_duration: 5, &block)
2
2
  attempts = 0
3
3
  while attempts < retries
4
4
  begin
5
- yield
5
+ return yield
6
6
  rescue => e
7
7
  puts "Retrying a failed action, error was:"
8
8
  puts e.message
@@ -11,4 +11,6 @@ def with_retries(retries, sleep_duration: 5, &block)
11
11
  attempts += 1
12
12
  end
13
13
  end
14
+
15
+ fail "Retries exceed (#{retries})"
14
16
  end
@@ -1,3 +1,3 @@
1
1
  module Linecook
2
- VERSION = '0.7.19'
2
+ VERSION = '0.7.20'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linecook-gem
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.19
4
+ version: 0.7.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Hamel