mina-data_sync 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 189a72cf302e49da6dd218a584a40b95dab6b84c
4
- data.tar.gz: 45551eeefb495721775d139079ab737e5c6dd600
3
+ metadata.gz: d81b2449d778519f0bc36481e98d133f0ce590a7
4
+ data.tar.gz: 5ad76b08d901c913992b7ef637e080bcab124c85
5
5
  SHA512:
6
- metadata.gz: fdd31793c16b9ce58c3506b09c6e70968272dd2cfb100b1f649fc0f6e9c7005129adf91f8492efafecee86fabc918e17dd41b6563dcc758cedb11e3c3944c838
7
- data.tar.gz: 7b9b272a3016c70d326f4f51317ff6408961e8a86e5c7733b86d1fc1ffcace5b2731b185ee7a466b9a8b2dfd2e237a0421f947d9dbcb2ddb3809f9f5fde90f3e
6
+ metadata.gz: fd0c4965dd1a7401ab673e6d9346507241992cd886dfa5473218f054535d6793c6f787b100306db404e48d627c01ae45fce95d7364f0b8edc75cb34962f6c0d7
7
+ data.tar.gz: 88ec9c154662ba21ac8454c0e56161d95f9da8a13a6d085d7f82400a2c31edebfc2968380ad94652e674d0125776a99ffcc7d008485bc77add8576e80c2e0164
@@ -10,13 +10,13 @@ COMMAND = <<-RUBY
10
10
  arguments = ""
11
11
  case adapter.to_s
12
12
  when "postgresql"
13
- arguments += "PGPASSWORD=" + password if password
13
+ arguments += "PGPASSWORD=" + password + " " if password
14
14
  arguments += method == "dump" ? "pg_dump" : "psql -q"
15
15
  arguments += " -d " + database if database
16
16
  arguments += " -h " + host if host
17
17
  arguments += " -U " + username if username
18
18
  arguments += " -p " + port.to_s if port
19
- arguments += " -O -c"
19
+ arguments += method == "dump" ? " -O -c" : ""
20
20
  when "mysql2"
21
21
  arguments += method == "dump" ? "mysqldump" : "mysql"
22
22
  arguments += " " + database if database
@@ -11,16 +11,18 @@ namespace :data_sync do
11
11
  queue "#{DATA_SYNC}"
12
12
  queue "mkdir -p #{remote_backup_path}"
13
13
  queue "CONFIG=$(#{rails} runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
14
- queue! %(eval $(data_sync "dump" "#{remote_backup_path}/#{backup_file}" "$CONFIG"))
14
+ queue %(data_sync "dump" "#{remote_backup_path}/#{backup_file}" "$CONFIG")
15
+ queue %(eval $(data_sync "dump" "#{remote_backup_path}/#{backup_file}" "$CONFIG"))
15
16
 
16
17
  to :after_hook do
17
18
  queue "echo '-----> Copying backup'"
18
19
  queue "mkdir -p #{local_backup_path}"
19
20
  queue "#{DATA_SYNC}"
20
- queue! "rsync --progress -e 'ssh -p #{port}' #{user}@#{domain}:#{deploy_to}/#{current_path}/#{remote_backup_path}/#{backup_file} #{local_backup_path}/#{backup_file}"
21
+ queue "rsync --progress -e 'ssh -p #{port}' #{user}@#{domain}:#{deploy_to}/#{current_path}/#{remote_backup_path}/#{backup_file} #{local_backup_path}/#{backup_file}"
21
22
  if restore_data == 'true'
22
23
  queue "echo '-----> Restoring database'"
23
- queue "CONFIG=$(#{rails} runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
24
+ queue "CONFIG=$(RAILS_ENV=development #{bundle_bin} exec rails runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
25
+ queue %(data_sync "restore" "#{local_backup_path}/#{backup_file}" "$CONFIG")
24
26
  queue %(eval $(data_sync "restore" "#{local_backup_path}/#{backup_file}" "$CONFIG"))
25
27
  end
26
28
  end
@@ -32,16 +34,18 @@ namespace :data_sync do
32
34
  to :before_hook do
33
35
  queue "echo '-----> Dumping database'"
34
36
  queue "#{DATA_SYNC}"
35
- queue "CONFIG=$(#{rails} runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
36
- queue! %(eval $(data_sync "dump" "#{local_backup_path}/#{backup_file}" "$CONFIG"))
37
+ queue "CONFIG=$(RAILS_ENV=development #{bundle_bin} exec rails runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
38
+ queue %(data_sync "dump" "#{local_backup_path}/#{backup_file}" "$CONFIG")
39
+ queue %(eval $(data_sync "dump" "#{local_backup_path}/#{backup_file}" "$CONFIG"))
37
40
  queue "echo '-----> Copying backup'"
38
- queue! "rsync --progress -e 'ssh -p #{port}' #{local_backup_path}/#{backup_file} #{user}@#{domain}:#{deploy_to}/#{current_path}/#{remote_backup_path}/#{backup_file}"
41
+ queue "rsync --progress -e 'ssh -p #{port}' #{local_backup_path}/#{backup_file} #{user}@#{domain}:#{deploy_to}/#{current_path}/#{remote_backup_path}/#{backup_file}"
39
42
  end
40
43
 
41
44
  if restore_data == 'true'
42
45
  queue "echo '-----> Restoring database'"
43
46
  queue "cd #{deploy_to}/#{current_path}"
44
47
  queue "CONFIG=$(#{rails} runner 'puts ActiveRecord::Base.connection.instance_variable_get(:@config).to_json')"
48
+ queue %(data_sync "restore" "#{remote_backup_path}/#{backup_file}" "$CONFIG")
45
49
  queue %(eval $(data_sync "restore" "#{remote_backup_path}/#{backup_file}" "$CONFIG"))
46
50
  end
47
51
  end
@@ -1,5 +1,5 @@
1
1
  module Mina
2
2
  module DataSync
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mina-data_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic