load_remote_db 0.1.18 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/load_remote_db/version.rb +1 -1
- data/lib/tasks/load_remote_db.rake +10 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc44f89b663b861ea0343ca1f3136cca1730f30d419f6d8a5ed2e13fb0c9b75d
|
4
|
+
data.tar.gz: b697109282f915a0195ab358838cf733948067f523a090eba1d48d3259a68fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fab27a1b21e4294cf5b47b8e164781d804cc8a019c3335b2d227dca03cfe2dca7483dcb0d3e20bfcb72bb28a768193fb8a0b63c1950c166f37bd60c4d2120b7d
|
7
|
+
data.tar.gz: 2edc68f1bc602bf17cc7b711d7f95d6988665cc7e0b209e7a8465ffcbfab4c29f291b9785d1ffc2d077d8b82c8eff43a2b10376d0b0f3a188e6bbee81377601e
|
@@ -43,7 +43,7 @@ class RemoteDbLoader
|
|
43
43
|
\\"require 'yaml'; \
|
44
44
|
puts YAML.load_file('#{@deploy_to}/shared/config/database.yml')['#{env}']\\""}
|
45
45
|
|
46
|
-
shared_path = "#{@deploy_to}/shared"
|
46
|
+
shared_path = ENV['TEMP_STORED_FOLDER'] || "#{@deploy_to}/shared"
|
47
47
|
|
48
48
|
puts get_db_info_command
|
49
49
|
remote_db_config = eval `#{get_db_info_command}`
|
@@ -55,7 +55,8 @@ class RemoteDbLoader
|
|
55
55
|
## run the real backup
|
56
56
|
puts 'Running the remote backup...'
|
57
57
|
mysql_cmd = "mysqldump -u #{remote_db_username} -p'#{remote_db_password}' \
|
58
|
-
-h #{remote_db_host} #{remote_db_name} >
|
58
|
+
-h #{remote_db_host} #{remote_db_name} > \
|
59
|
+
#{shared_path}/backup.sql".shellescape
|
59
60
|
backup_command = %(ssh #{@server_user}@#{@server_ip} -p#{port} #{mysql_cmd})
|
60
61
|
system(backup_command)
|
61
62
|
|
@@ -117,8 +118,8 @@ class RemoteDbLoader
|
|
117
118
|
puts "Synchorinizing #{to_be_rsync_folder} folder..."
|
118
119
|
`mkdir -p #{to_be_rsync_folder}`
|
119
120
|
sync_folder_cmd = %(rsync -r \
|
120
|
-
#{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder} \
|
121
|
-
|
121
|
+
#{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder}/ \
|
122
|
+
#{to_be_rsync_folder})
|
122
123
|
puts sync_folder_cmd
|
123
124
|
system(sync_folder_cmd)
|
124
125
|
end
|
@@ -127,7 +128,7 @@ class RemoteDbLoader
|
|
127
128
|
end
|
128
129
|
|
129
130
|
def method_missing(name, *args, &block)
|
130
|
-
if name == :fetch && args[0] == :deploy_user
|
131
|
+
if name == :fetch && (args[0] == :deploy_user || args[0] == :user)
|
131
132
|
return @server_user
|
132
133
|
end
|
133
134
|
|
@@ -155,6 +156,9 @@ class RemoteDbLoader
|
|
155
156
|
@application ||= args[1] if name == :set && args[0] == :application
|
156
157
|
@full_app_name ||= args[1] if name == :set && args[0] == :full_app_name
|
157
158
|
@port ||= args[1] if name == :set && args[0] == :port
|
158
|
-
|
159
|
+
if name == :set && args[0] == :deploy_to
|
160
|
+
puts args[1]
|
161
|
+
@deploy_to ||= args[1]
|
162
|
+
end
|
159
163
|
end
|
160
164
|
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.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Huynh
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|