capistrano-s3_archive 0.3.5 → 0.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/capistrano/s3_archive/version.rb +1 -1
- data/lib/capistrano/s3_archive.rb +19 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ecfcfadd59e8c957d1d85db6b15490bb3e24395
|
4
|
+
data.tar.gz: c1d697b601b3e4fd0a5b57cdd6a7ee9ed38a6305
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c5ca9d947f7fad702553e498cbd44cd555004903ae60356db4fd4a02d3731d5c088eff0defccfcca6b8db03fd8b90c255e7ebf561a7bb32e06a99b2cc1c7b76
|
7
|
+
data.tar.gz: 55d26357752657c69f03c0eaf3666dcadb13661b29b86bb88d460ced0d43f2efc7ab95f64536fbf0e63869470c289f88bf2f21dcdf881a67aa8c1ab03da3c66f
|
@@ -5,12 +5,12 @@ load File.expand_path("../tasks/s3_archive.rake", __FILE__)
|
|
5
5
|
require "capistrano/s3_archive/version"
|
6
6
|
require 'capistrano/scm'
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
set_if_empty :rsync_options, ['-az --delete']
|
9
|
+
set_if_empty :rsync_copy, "rsync --archive --acls --xattrs"
|
10
|
+
set_if_empty :rsync_cache, "shared/deploy"
|
11
|
+
set_if_empty :local_cache, "tmp/deploy"
|
12
|
+
set_if_empty :s3_archive, "tmp/archives"
|
13
|
+
set_if_empty :sort_proc, ->(a,b) { b.key <=> a.key }
|
14
14
|
|
15
15
|
module Capistrano
|
16
16
|
module S3Archive
|
@@ -71,6 +71,7 @@ module Capistrano
|
|
71
71
|
|
72
72
|
def check
|
73
73
|
list_objects(false)
|
74
|
+
return if context.class == SSHKit::Backend::Local
|
74
75
|
ssh_key = context.host.keys.first || Array(context.host.ssh_options[:keys]).first
|
75
76
|
if ssh_key.nil?
|
76
77
|
fail MissingSSHKyesError, "#{RsyncStrategy} only supports publickey authentication. Please set #{context.host.hostname}.keys or ssh_options."
|
@@ -126,16 +127,20 @@ module Capistrano
|
|
126
127
|
end
|
127
128
|
|
128
129
|
def release(server = context.host)
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
130
|
+
unless context.class == SSHKit::Backend::Local
|
131
|
+
user = server.user + '@' unless server.user.nil?
|
132
|
+
key = server.keys.first || Array(server.ssh_options[:keys]).first
|
133
|
+
ssh_port_option = server.port.nil? ? '' : "-p #{server.port}"
|
134
|
+
end
|
133
135
|
rsync = ['rsync']
|
134
136
|
rsync.concat fetch(:rsync_options)
|
135
137
|
rsync << fetch(:local_cache_dir) + '/'
|
136
|
-
|
137
|
-
|
138
|
-
|
138
|
+
unless context.class == SSHKit::Backend::Local
|
139
|
+
rsync << "-e 'ssh -i #{key} #{ssh_port_option}'"
|
140
|
+
rsync << "#{user}#{server.hostname}:#{rsync_cache || release_path}"
|
141
|
+
else
|
142
|
+
rsync << "#{rsync_cache || release_path}"
|
143
|
+
end
|
139
144
|
release_lock do
|
140
145
|
run_locally do
|
141
146
|
execute *rsync
|
@@ -144,7 +149,7 @@ module Capistrano
|
|
144
149
|
|
145
150
|
unless fetch(:rsync_cache).nil?
|
146
151
|
cache = rsync_cache
|
147
|
-
on server do
|
152
|
+
on [server] do
|
148
153
|
copy = %(#{fetch(:rsync_copy)} "#{cache}/" "#{release_path}/")
|
149
154
|
execute copy
|
150
155
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-s3_archive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takuto Komazaki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|