load_remote_db 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/load_remote_db/version.rb +1 -1
- data/lib/tasks/load_remote_db.rake +10 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76cb1980c871da64c2a8c9bf320b20fb06168269
|
4
|
+
data.tar.gz: b4f234ea9d192f44347b72eefa33766caf63a263
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10326c8102959b20327ccf657c3d145b78d13d6da15fa02638cd94a9ef6d22ec9307069178ffcc28ad36dbb83f09f5313ac396a66e9b328a19293a73c52214d8
|
7
|
+
data.tar.gz: c074b0dc0ee7703d4e4aa3f4527990b8747e6cab6f59455bc17fb457dcba12387bf839aa802f906368c56081ec9a97fabc5904f6b4b86ad58c478cffb6d14198
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ Simply execute the command:
|
|
35
35
|
For instance
|
36
36
|
|
37
37
|
$ bundle exec rake db:load_from_remote SERVER=staging
|
38
|
-
$ bundle exec rake db:load_from_remote SERVER=staging SYNC_FOLDER=public/system
|
38
|
+
$ bundle exec rake db:load_from_remote SERVER=staging SYNC_FOLDER=public/system/
|
39
39
|
$ bundle exec rake db:load_from_remote SERVER=staging DOWNLOAD_ONLY=true
|
40
40
|
|
41
41
|
|
@@ -24,6 +24,7 @@ class RemoteDbLoader
|
|
24
24
|
password = development_db['password']
|
25
25
|
database = development_db['database']
|
26
26
|
|
27
|
+
eval File.read("#{Rails.root}/config/deploy.rb")
|
27
28
|
eval File.read("#{Rails.root}/config/deploy/#{env}.rb")
|
28
29
|
|
29
30
|
## get remote database config.yml
|
@@ -34,6 +35,7 @@ class RemoteDbLoader
|
|
34
35
|
|
35
36
|
shared_path = "#{@deploy_to}/shared"
|
36
37
|
|
38
|
+
puts get_db_info_command
|
37
39
|
remote_db_config = eval `#{get_db_info_command}`
|
38
40
|
remote_db_username = remote_db_config["username"] || 'root'
|
39
41
|
remote_db_password = remote_db_config["password"]
|
@@ -115,6 +117,9 @@ class RemoteDbLoader
|
|
115
117
|
end
|
116
118
|
|
117
119
|
def method_missing(name, *args, &block)
|
120
|
+
return @server_user if name == :fetch && args[0] == :deploy_user
|
121
|
+
return @application if name == :fetch && args[0] == :application
|
122
|
+
|
118
123
|
return self unless %I[server set].include?(name)
|
119
124
|
@server_ip ||= if name == :server
|
120
125
|
args[0]
|
@@ -122,6 +127,10 @@ class RemoteDbLoader
|
|
122
127
|
args[1]
|
123
128
|
end
|
124
129
|
@server_user ||= args[1] if name == :set && args[0] == :user
|
125
|
-
@
|
130
|
+
@application ||= args[1] if name == :set && args[0] == :application
|
131
|
+
@server_user ||= args[1] if name == :set && args[0] == :deploy_user
|
132
|
+
if name == :set && args[0] == :deploy_to
|
133
|
+
@deploy_to ||= args[1]
|
134
|
+
end
|
126
135
|
end
|
127
136
|
end
|
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.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|