load_remote_db 0.1.16 → 0.1.21

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: e4d920151210f82bd45ee8d11875b082ba0db033173fa52f1500c7edcf2f622c
4
- data.tar.gz: 3deeacfb55c427c52b45cd59b760732ae09289fa6a5274db4c2e8a360db56640
3
+ metadata.gz: d06b4be8b95d62ce98257d2798e317c1d04067bd92ff07dbaf74de01b4e7caed
4
+ data.tar.gz: 6ee1b896b5dc8aa51e842d1762a84c1ee16f26030eca148912b25e1e867e3157
5
5
  SHA512:
6
- metadata.gz: 466c3a6c4cf769f1a342ad469a313e065e66d9c762ffcbce527fa487989b25c0f15ca8a0f73081a63c47668be6ef90127e4493fe8bde0396946694ce5ed643d9
7
- data.tar.gz: b3fee5e8923b72fed6bb7908b78fa47f7eaa4a16f61a624032f13756a34f73c90bf519e449957a36343fb7d747cb34fb97643dcc5e52b6e12887a121915c6336
6
+ metadata.gz: 3fd01cb1e4ac53d586647cab1555b27f3ebd4599bca1e7c3ee4c0d97f4a93ab62798b89eebd92784ca45aebcd92b41452fe90af79eae95e0d123dde38706b7f0
7
+ data.tar.gz: b5e35fb5c33d138cdf8658d793549b5523e031e3ea618778f41dcaa2fd5d7519d7e1fa4315c297453f32ea02e8647690b912aad5d2c66846f199a16207205511
@@ -1,3 +1,3 @@
1
1
  module LoadRemoteDb
2
- VERSION = '0.1.16'.freeze
2
+ VERSION = '0.1.21'.freeze
3
3
  end
@@ -47,13 +47,16 @@ class RemoteDbLoader
47
47
 
48
48
  puts get_db_info_command
49
49
  remote_db_config = eval `#{get_db_info_command}`
50
- http://203.149.141.68:8080/xxremote_db_host = remote_db_config["host"] || 'localhost'
50
+ remote_db_host = remote_db_config["host"] || 'localhost'
51
51
  remote_db_name = remote_db_config["database"]
52
+ remote_db_username = remote_db_config["username"] || 'root'
53
+ remote_db_password = remote_db_config["password"]
52
54
 
53
55
  ## run the real backup
54
56
  puts 'Running the remote backup...'
55
57
  mysql_cmd = "mysqldump -u #{remote_db_username} -p'#{remote_db_password}' \
56
- -h #{remote_db_host} #{remote_db_name} > #{shared_path}/backup.sql".shellescape
58
+ -h #{remote_db_host} --set-gtid-purged=OFF #{remote_db_name} > \
59
+ #{shared_path}/backup.sql".shellescape
57
60
  backup_command = %(ssh #{@server_user}@#{@server_ip} -p#{port} #{mysql_cmd})
58
61
  system(backup_command)
59
62
 
@@ -115,8 +118,8 @@ class RemoteDbLoader
115
118
  puts "Synchorinizing #{to_be_rsync_folder} folder..."
116
119
  `mkdir -p #{to_be_rsync_folder}`
117
120
  sync_folder_cmd = %(rsync -r \
118
- #{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder} \
119
- '#{to_be_rsync_folder}')
121
+ #{@server_user}@#{@server_ip}:#{shared_path}/#{to_be_rsync_folder}/ \
122
+ #{to_be_rsync_folder})
120
123
  puts sync_folder_cmd
121
124
  system(sync_folder_cmd)
122
125
  end
@@ -125,7 +128,7 @@ class RemoteDbLoader
125
128
  end
126
129
 
127
130
  def method_missing(name, *args, &block)
128
- if name == :fetch && args[0] == :deploy_user
131
+ if name == :fetch && (args[0] == :deploy_user || args[0] == :user)
129
132
  return @server_user
130
133
  end
131
134
 
@@ -153,6 +156,9 @@ class RemoteDbLoader
153
156
  @application ||= args[1] if name == :set && args[0] == :application
154
157
  @full_app_name ||= args[1] if name == :set && args[0] == :full_app_name
155
158
  @port ||= args[1] if name == :set && args[0] == :port
156
- @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
157
163
  end
158
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.16
4
+ version: 0.1.21
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