dockly 1.5.15 → 1.5.16

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.
@@ -1,3 +1,3 @@
1
1
  module Dockly
2
- VERSION = '1.5.15'
2
+ VERSION = '1.5.16'
3
3
  end
@@ -1,11 +1,11 @@
1
- log "fetch: starting to fetch deb"
2
1
  worked=1
3
2
  s3_path="<%= data[:s3_url] %>"
4
3
  output_path="<%= data[:output_path] %>"
4
+ log "fetch: starting to fetch $s3_path"
5
5
  for attempt in {1..200}; do
6
6
  [[ $worked != 0 ]] || break
7
7
  log "fetch: attempt ${attempt} to get $s3_path ..."
8
- s3cmd -f get $s3_path $output_path && worked=0 || (log "fetch: attempt failed, sleeping 30"; sleep 30)
8
+ s3cmd -f get $s3_path $output_path 2> >(log) && worked=0 || (log "fetch: attempt failed, sleeping 30"; sleep 30)
9
9
  done
10
10
  [[ $worked != 0 ]] && fatal "fetch: failed to pull deb from S3"
11
- log "fetch: successfully fetched deb"
11
+ log "fetch: successfully fetched $s3_path"
@@ -5,10 +5,22 @@ base_image = "/opt/dockly/base_image.tar"
5
5
  s3_diff_docker_import_base_fn() {
6
6
  <%= get_from_s3(data[:base_image]) %>
7
7
  }
8
+
8
9
  s3_diff_docker_import_diff_fn() {
9
10
  <%= get_from_s3(data[:diff_image]) %>
10
11
  }
11
- s3_diff_docker_import_base_fn | gunzip -c > "<%= base_image %>"
12
+
13
+ stream_image() {
12
14
  size=$(stat --format "%s" "<%= base_image %>")
13
15
  head_size=$(($size - 1024))
14
- (head -c $head_size "<%= base_image %>"; s3_diff_docker_import_diff_fn | gunzip -c) | <%= docker_import(data[:repo], data[:tag]) %>
16
+ head -c $head_size "<%= base_image %>"
17
+ s3_diff_docker_import_diff_fn | (gunzip -vc 2> >(log) || fatal "tardiff failed to gunzip")
18
+ }
19
+
20
+ docker_import() {
21
+ <%= docker_import(data[:repo], data[:tag]).to_s.strip %> > >(log) 2>&1 || fatal "docker failed to import"
22
+ }
23
+
24
+ s3_diff_docker_import_base_fn | gunzip -vc > "<%= base_image %>" 2> >(log)
25
+
26
+ stream_image | docker_import
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.5.15
4
+ version: 1.5.16
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: