capistrano-s3_archive 0.3.5 → 0.3.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbb8ac4ef17a2d5f929a0efb027aad17c7e44790
4
- data.tar.gz: 099ba5e45ea14ef7ea1306ab7e953b2817b8f032
3
+ metadata.gz: 4ecfcfadd59e8c957d1d85db6b15490bb3e24395
4
+ data.tar.gz: c1d697b601b3e4fd0a5b57cdd6a7ee9ed38a6305
5
5
  SHA512:
6
- metadata.gz: c590bcb06845ded9939f19123dbb67d9c264fa030d6e6f36b479293e0b178b470d1746455a887c41666d62617f59c56e56a8095db83a42b994f0efe48388031e
7
- data.tar.gz: 2780597ad293784dc7052fd42e0f9e56ecee02a58e62fa737a0ebe07f3796ad9105008de086a2250a4ea634a1e33c7eb4ceab40212244e0a0712f9c7553680e4
6
+ metadata.gz: 0c5ca9d947f7fad702553e498cbd44cd555004903ae60356db4fd4a02d3731d5c088eff0defccfcca6b8db03fd8b90c255e7ebf561a7bb32e06a99b2cc1c7b76
7
+ data.tar.gz: 55d26357752657c69f03c0eaf3666dcadb13661b29b86bb88d460ced0d43f2efc7ab95f64536fbf0e63869470c289f88bf2f21dcdf881a67aa8c1ab03da3c66f
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module S3Archive
3
- VERSION = "0.3.5"
3
+ VERSION = "0.3.6"
4
4
  end
5
5
  end
@@ -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
- set :rsync_options, ['-az --delete']
9
- set :rsync_copy, "rsync --archive --acls --xattrs"
10
- set :rsync_cache, "shared/deploy"
11
- set :local_cache, "tmp/deploy"
12
- set :s3_archive, "tmp/archives"
13
- set :sort_proc, ->(a,b) { b.key <=> a.key }
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
- user = server.user + '@' unless server.user.nil?
130
- key = server.keys.first || Array(server.ssh_options[:keys]).first
131
- ssh_port_option = server.port.nil? ? '' : "-p #{server.port}"
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
- rsync << "-e 'ssh -i #{key} #{ssh_port_option}'"
137
- rsync << "#{user}#{server.hostname}:#{rsync_cache || release_path}"
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.5
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-25 00:00:00.000000000 Z
11
+ date: 2015-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano