load_remote_db 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/load_remote_db/version.rb +1 -1
- data/lib/tasks/load_remote_db.rake +4 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c97ac558efcfccb717dbf492f39fb06fdb68301718a3519fb65b4b96467e933a
|
4
|
+
data.tar.gz: f832ee88511e4c650c622ed932d1faf9e699a5e6d6e686cfc847b5035ce149bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e9b1632685f1db0a3ab9a29716bb10582265b7ea936c12b23d8ec62312354f18f942c426151e33703bdbd20e92801949963eac12b17d7906ce97e07c0c4e77d
|
7
|
+
data.tar.gz: 34b166c128a041d5f784a7a2d91834f237d5e5776d95a578d9bbea936f9da606795a518142a3e231e991b8f5553ab898008ddb7ba46aecefffeadfb154f0d0a3
|
@@ -23,6 +23,7 @@ class RemoteDbLoader
|
|
23
23
|
username = development_db['username'] || 'root'
|
24
24
|
password = development_db['password']
|
25
25
|
database = development_db['database']
|
26
|
+
host = development_db['host']
|
26
27
|
|
27
28
|
begin
|
28
29
|
eval File.read("#{Rails.root}/config/deploy.rb")
|
@@ -48,7 +49,7 @@ class RemoteDbLoader
|
|
48
49
|
remote_db_config = eval `#{get_db_info_command}`
|
49
50
|
remote_db_username = remote_db_config["username"] || 'root'
|
50
51
|
remote_db_password = remote_db_config["password"]
|
51
|
-
remote_db_host = remote_db_config["host"]
|
52
|
+
remote_db_host = remote_db_config["host"] || 'localhost'
|
52
53
|
remote_db_name = remote_db_config["database"]
|
53
54
|
|
54
55
|
## run the real backup
|
@@ -99,10 +100,10 @@ class RemoteDbLoader
|
|
99
100
|
|
100
101
|
if password == nil
|
101
102
|
import_db_cmd =
|
102
|
-
%(mysql -u #{username} #{database} < backup.sql)
|
103
|
+
%(mysql -u #{username} #{database} -h #{remote_db_host} < backup.sql)
|
103
104
|
else
|
104
105
|
import_db_cmd =
|
105
|
-
%(mysql -u #{username} -p'#{password}' #{database} < backup.sql)
|
106
|
+
%(mysql -u #{username} -p'#{password}' -h #{remote_db_host} #{database} < backup.sql)
|
106
107
|
end
|
107
108
|
|
108
109
|
puts 'Importing database into local environment...'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: load_remote_db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -77,7 +77,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
77
|
version: '0'
|
78
78
|
requirements: []
|
79
79
|
rubyforge_project:
|
80
|
-
rubygems_version: 2.6
|
80
|
+
rubygems_version: 2.7.6
|
81
81
|
signing_key:
|
82
82
|
specification_version: 4
|
83
83
|
summary: Load MySQL Remote DB for Mina/Capistrano
|