capistrano-shortcuts 0.6.1 → 0.7.0

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: 9013af032f3b5bf35417397388819b1675044e5b
4
- data.tar.gz: ef8a5ff9d741326842bb01abef8cbbcf5adf33f0
3
+ metadata.gz: 069f3f05499903ac48decabe44d43bbb6139920e
4
+ data.tar.gz: 1333bdaee1fcdbca80e2c793bdd536f9d2a0360c
5
5
  SHA512:
6
- metadata.gz: 824b2979f951aad98089840f7af147fc28bca558d7a47ae94ad0f5abb5b36797ba1a8c1994fc2ccb3e9cef66245bd6644c126429d1076ec8d9839d140987519e
7
- data.tar.gz: c6de0aeed3965dc8e31fef26b80bb7528c840d06f61cad746e98f19aaf8ba866e91b406d72c44af18ce38811cf2e79637449b4fb02969b2023e0f885a961cb47
6
+ metadata.gz: 2db7a27dd14a4d08fb6bfc9654ec8c2ddda3b51342f556864c88ba553dfa79c8ca48f8dc9caf805e4a194609cf078b39e1cddd8eb09b34fa82d4eb83088c49e8
7
+ data.tar.gz: 07e6463ea9d45919fca6dc0a17359f1729ed283ebae2a06ba14eb9674aacbd33d90cb5d341a37c2c7750e0a40ab372c1d9d6cc3b40dc12e7b174bf091310d126
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- capistrano-shortcuts (0.6.1)
4
+ capistrano-shortcuts (0.7.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -22,7 +22,12 @@ namespace :db do
22
22
  else
23
23
  domain = db_config[fetch(:rails_env)]['host']
24
24
  end
25
- execute("scp -i #{fetch(:aws_key_pair)} #{fetch(:user)}@#{domain}:~/#{dump_file}.gz .")
25
+ command = "scp "
26
+ if fetch(:aws_key_pair)
27
+ command += "-i #{fetch(:aws_key_pair)} "
28
+ end
29
+ command += "#{fetch(:user)}@#{domain}:~/#{dump_file}.gz ."
30
+ execute(command)
26
31
  end
27
32
  execute("rm #{dump_file}.gz")
28
33
  run_locally do
@@ -60,7 +65,12 @@ namespace :db do
60
65
  domain = db_config[fetch(:rails_env)]['host']
61
66
  end
62
67
 
63
- execute("scp -i #{fetch(:aws_key_pair)} #{dump_file}.gz #{fetch(:user)}@#{domain}:~")
68
+ command = "scp "
69
+ if fetch(:aws_key_pair)
70
+ command += "-i #{fetch(:aws_key_pair)} "
71
+ end
72
+ command += "#{dump_file}.gz #{fetch(:user)}@#{domain}:~"
73
+ execute(command)
64
74
  execute("rm #{dump_file}.gz")
65
75
  end
66
76
  on roles(:db) do
@@ -80,11 +90,15 @@ namespace :db do
80
90
  end
81
91
 
82
92
  def dump_db(config, output_file)
83
- execute("MYSQL_PWD=#{config['password']} " +
93
+ command = "MYSQL_PWD=#{config['password']} " +
84
94
  "mysqldump -f " +
85
- "-u #{config['username']} " +
86
- "#{config['database']} " +
87
- "-r #{output_file}")
95
+ "-u #{config['username']} "
96
+ if config['db_host']
97
+ command += "-h #{config['db_host']} "
98
+ end
99
+ command += "#{config['database']} " +
100
+ "-r #{output_file}"
101
+ execute(command)
88
102
  execute("gzip -f #{output_file}")
89
103
  end
90
104
 
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Shortcuts
3
- VERSION = "0.6.1"
3
+ VERSION = "0.7.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-shortcuts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Todd Gehman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler