capistrano-alchemy 0.2.0 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf9597911523ef71181e42d21c45c701c684205
|
4
|
+
data.tar.gz: f0a7c1abd703d6246d6191ee6b698ffd35c03ae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d945b45ef595c8a332617d927e33ba6723730c0aee18c3a966c2d81cd18178ad35e78354592e0b0205a7c61f0f45c7026dea6e70001dc6dc214fc229d76ec9bd
|
7
|
+
data.tar.gz: 1a7c210e28166b934666ee0fe6f17726fbfa8adde6d3def6ff56366d6c85bab312d9761b271963109e9a033d5074c82112c2734d5f30b3fbfd3b2a100ec4ae62
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'spinner'
|
2
|
-
|
3
1
|
module Capistrano::Alchemy::DeploySupport
|
4
2
|
# Makes a backup of the remote database and stores it in db/ folder
|
5
3
|
def backup_database
|
@@ -16,7 +14,8 @@ module Capistrano::Alchemy::DeploySupport
|
|
16
14
|
|
17
15
|
def db_import_cmd(server)
|
18
16
|
raise "No server given" if !server
|
19
|
-
|
17
|
+
env = "RAILS_ENV=#{fetch(:rails_env, 'production')}"
|
18
|
+
dump_cmd = "cd #{release_path} && #{rake_cmd} alchemy:db:dump #{env}"
|
20
19
|
sql_stream = "#{ssh_command(server)} '#{dump_cmd}'"
|
21
20
|
"#{sql_stream} | #{database_import_command(database_config['adapter'])} 1>/dev/null 2>&1"
|
22
21
|
end
|
@@ -24,7 +23,8 @@ module Capistrano::Alchemy::DeploySupport
|
|
24
23
|
# The actual export command that sends the data
|
25
24
|
def db_export_cmd(server)
|
26
25
|
raise "No server given" if !server
|
27
|
-
|
26
|
+
env = "RAILS_ENV=#{fetch(:rails_env, 'production')}"
|
27
|
+
import_cmd = "cd #{release_path} && #{rake_cmd} alchemy:db:import #{env}"
|
28
28
|
ssh_cmd = "#{ssh_command(server)} '#{import_cmd}'"
|
29
29
|
"#{database_dump_command(database_config['adapter'])} | #{ssh_cmd}"
|
30
30
|
end
|
@@ -46,10 +46,14 @@ module Capistrano::Alchemy::DeploySupport
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def ssh_command(server)
|
49
|
-
"ssh -p #{ssh_port(server)} #{server.user}@#{server.hostname}"
|
49
|
+
"ssh -C -p #{ssh_port(server)} #{server.user}@#{server.hostname}"
|
50
50
|
end
|
51
51
|
|
52
52
|
def ssh_port(server)
|
53
53
|
server.port || 22
|
54
54
|
end
|
55
|
+
|
56
|
+
def rake_cmd
|
57
|
+
SSHKit.config.command_map[:rake]
|
58
|
+
end
|
55
59
|
end
|
@@ -41,9 +41,10 @@ namespace :alchemy do
|
|
41
41
|
desc "Imports the server database into your local development machine."
|
42
42
|
task database: ['alchemy:default_paths', 'deploy:check'] do
|
43
43
|
on roles :db do |server|
|
44
|
-
puts
|
44
|
+
puts '## Importing database'
|
45
|
+
puts ' Please wait! This may take some time...'
|
45
46
|
system db_import_cmd(server)
|
46
|
-
puts
|
47
|
+
puts ' done.'
|
47
48
|
end
|
48
49
|
end
|
49
50
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-alchemy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano-rails
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.5.1
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Capistrano Tasks for AlchemyCMS.
|