capistrano-s3_archive 0.3.9 → 0.3.10

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: 8099885e253e2283ea9b2c86cbdddd7e0f6263ad
4
- data.tar.gz: dc35bc64c15adf44abf5c2a952448b36aeb312d8
3
+ metadata.gz: 5a8c996040a7790ff1a596a28b0831ea45aa7ce8
4
+ data.tar.gz: dc697ea439e36316ca1e53bfbb9b78899085eb3c
5
5
  SHA512:
6
- metadata.gz: 3a588f84614d9c584217e0b94009ad9a49c1852856c7fa6355515551c8f22a2d55030c90ec24a218ae946f651613b4844151b3f46518313d0d8d7e2f8317c741
7
- data.tar.gz: 4dc224f56800eb74bfd02d149586a0ed544e298a877f80d92d3930aeca58eab562f161ef9a681d511cdb1b1ff5053d7b9cd2289d70488787fda50f9e16c72fb3
6
+ metadata.gz: d880c7190585d09d07f0daceb55a46356b77db33f8f47a599367227d5bf26184cfc05c964e9c2acab92e6069e11d2e9c145c7ed75949832baccf955953186f09
7
+ data.tar.gz: 94fb5aecf5ae0d807a779b028aea5a8f6884f7e002969e08c40abcf0934c896b8a9522862cdaefa0107755322bd74f11d6befe92e28ed0fce53201d3f2707e44
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module S3Archive
3
- VERSION = "0.3.9"
3
+ VERSION = "0.3.10"
4
4
  end
5
5
  end
@@ -72,7 +72,7 @@ module Capistrano
72
72
  def check
73
73
  list_objects(false)
74
74
  return if context.class == SSHKit::Backend::Local
75
- ssh_key = context.host.keys.first || Array(context.host.ssh_options[:keys]).first
75
+ ssh_key = ssh_key_for(context.host)
76
76
  if ssh_key.nil?
77
77
  fail MissingSSHKyesError, "#{RsyncStrategy} only supports publickey authentication. Please set #{context.host.hostname}.keys or ssh_options."
78
78
  end
@@ -129,7 +129,7 @@ module Capistrano
129
129
  def release(server = context.host)
130
130
  unless context.class == SSHKit::Backend::Local
131
131
  user = server.user + '@' unless server.user.nil?
132
- key = server.keys.first || Array(server.ssh_options[:keys]).first
132
+ key = ssh_key_for(server)
133
133
  ssh_port_option = server.port.nil? ? '' : "-p #{server.port}"
134
134
  end
135
135
  rsync = ['rsync']
@@ -164,6 +164,16 @@ module Capistrano
164
164
  archive_object_key
165
165
  end
166
166
 
167
+ def ssh_key_for(host)
168
+ if not host.keys.empty?
169
+ host.keys.first
170
+ elsif host.ssh_options && host.ssh_options.has_key?(:keys)
171
+ Array(host.ssh_options[:keys]).first
172
+ else fetch(:ssh_options, nil) && fetch(:ssh_options).has_key?(:keys)
173
+ fetch(:ssh_options)[:keys].first
174
+ end
175
+ end
176
+
167
177
  private
168
178
  def rsync_cache
169
179
  cache = fetch(:rsync_cache)
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.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takuto Komazaki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-13 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.4.5.1
112
+ rubygems_version: 2.5.1
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: Capistrano deployment from an archive on Amazon S3.