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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 26069fbdcdad63d69073dec3b4232a111f8f49d5e0e756b8652934dd4dcce4dd
4
- data.tar.gz: 3ddc0fc36cf34c17471f32bb3e2b793d9ba4d52f0ff2b8725d7a3b06b1bc26bb
3
+ metadata.gz: fc44f89b663b861ea0343ca1f3136cca1730f30d419f6d8a5ed2e13fb0c9b75d
4
+ data.tar.gz: b697109282f915a0195ab358838cf733948067f523a090eba1d48d3259a68fa6
5
5
  SHA512:
6
- metadata.gz: d3faedf2aa6eb6c4691a38dfa46dc29801b7ea2b8ca09ea4b0bb46ba9d025c758fbb4ede5495cce8f608f56ab37e30e9c56a9470a81a1d418ccfbae8bccae63d
7
- data.tar.gz: 0b6d7790000a47d06a0b537e7a53d4992f7bd1a94f818c33a89e1a3d688d655a863e6a96dbb5ee4c0cb5cb91b57a5b370c1272d7e8975f40c3aa2762f433392c
6
+ metadata.gz: fab27a1b21e4294cf5b47b8e164781d804cc8a019c3335b2d227dca03cfe2dca7483dcb0d3e20bfcb72bb28a768193fb8a0b63c1950c166f37bd60c4d2120b7d
7
+ data.tar.gz: 2edc68f1bc602bf17cc7b711d7f95d6988665cc7e0b209e7a8465ffcbfab4c29f291b9785d1ffc2d077d8b82c8eff43a2b10376d0b0f3a188e6bbee81377601e
@@ -1,3 +1,3 @@
1
1
  module LoadRemoteDb
2
- VERSION = '0.1.18'.freeze
2
+ VERSION = '0.1.23'.freeze
3
3
  end
@@ -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} > #{shared_path}/backup.sql".shellescape
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
- '#{to_be_rsync_folder}')
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
- @deploy_to ||= args[1] if name == :set && args[0] == :deploy_to
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.18
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-07-11 00:00:00.000000000 Z
11
+ date: 2019-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler