capistrano-s3_archive 1.0.0 → 1.0.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a20a72d912509e3ebdaaa307d277eac7aabecb6f813f693f79587dae5fda30e0
|
4
|
+
data.tar.gz: 4cd09c4d098e33453b067290710e638c555df182c612cc33461e68fe3076c759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c124c5c0b74ced2381d7503dbfda2a32b6fd6a945e8fa8b24b54ea33a503d1d41a787c6ca8c473c4f570e64009547165f669b9bc780f3890d12efa3802bd8268
|
7
|
+
data.tar.gz: 0eb0a0b8e880c83021392e53204cdfb39b7a9be55e238569d42323cae31e3ac8e888a950677f5f50b246837a52a437fa52d7bfad28cdcf91c11a4f27bf5de140
|
@@ -11,7 +11,6 @@ module Capistrano
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def download
|
14
|
-
tmp_file = "#{target_file}.part"
|
15
14
|
etag_file = File.join(download_dir, ".#{archive_object.key_basename}.etag")
|
16
15
|
if backend.test("[ -f #{target_file} -a -f #{etag_file} ]") &&
|
17
16
|
backend.capture(:cat, etag_file) == archive_object.etag
|
@@ -19,8 +18,8 @@ module Capistrano
|
|
19
18
|
else
|
20
19
|
backend.info "Download s3://#{archive_object.bucket}/#{archive_object.key} to #{target_file}"
|
21
20
|
backend.execute(:mkdir, "-p", download_dir)
|
22
|
-
backend.execute(:aws, *['s3api', 'get-object', "--bucket #{archive_object.bucket}", "--key #{archive_object.key}", archive_object.version_id ? "--version-id #{archive_object.version_id}" : nil,
|
23
|
-
|
21
|
+
backend.execute(:aws, *['s3api', 'get-object', "--bucket #{archive_object.bucket}", "--key #{archive_object.key}", archive_object.version_id ? "--version-id #{archive_object.version_id}" : nil, target_file].compact)
|
22
|
+
|
24
23
|
backend.execute(:echo, "-n", "'#{archive_object.etag}'", "|tee", etag_file)
|
25
24
|
end
|
26
25
|
end
|
@@ -36,7 +35,7 @@ module Capistrano
|
|
36
35
|
end
|
37
36
|
|
38
37
|
def target_file
|
39
|
-
basename = [archive_object.key_basename, archive_object.version_id].join('
|
38
|
+
basename = [archive_object.key_basename, archive_object.version_id].join('__')
|
40
39
|
File.join(download_dir, basename)
|
41
40
|
end
|
42
41
|
end
|