dockly 1.5.15 → 1.5.16
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dockly/version.rb +1 -1
- data/snippets/get_from_s3.erb +3 -3
- data/snippets/s3_diff_docker_import.erb +14 -2
- metadata +1 -1
data/lib/dockly/version.rb
CHANGED
data/snippets/get_from_s3.erb
CHANGED
@@ -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
|
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
|
-
|
12
|
+
|
13
|
+
stream_image() {
|
12
14
|
size=$(stat --format "%s" "<%= base_image %>")
|
13
15
|
head_size=$(($size - 1024))
|
14
|
-
|
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
|