cloner 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d91496eb70533c97b6b264f5c3227d39fdf7bf8d
4
- data.tar.gz: 89d14919ac270d8330e2e3a97a742ac22af5ac12
3
+ metadata.gz: 16802f5e33d2ec7ee1125de6181c768acf050e05
4
+ data.tar.gz: 102b5732b777d4aa5c2a36d9cfed1be97dcf4be6
5
5
  SHA512:
6
- metadata.gz: ecad6c543649f1e0ec0fd242e2ac6951ba79a39daeba06fc3a770b34aedcc5a2de765aae4f4364e22580ee67ed6de81bff25f7ea344be29f7fd71ac512d20d8c
7
- data.tar.gz: f0b5654880a8a5ffc77c42a5208da43434c19e62e1141e3fe0cf11cf7576b49090edae9a10b7296a99deb62db58c7158adf674401ffdf833c3273a810042af77
6
+ metadata.gz: ed39fa7e86356730b021924cda9e07f040e9e1108bfa57b32aa78eb9e26d6da82b65a99a6504c29a04ba53b198497bb2e48ccc4aa89e7c1356c4f5c438ebc13b
7
+ data.tar.gz: 999f75fb8d067c7470ccb1d7f35a5a6511b1058bafa0c9d6d6b83bbe7357766af7b1a5f7f8c5a6944d59b12319283ee1cf6ae80c390e49a076089b753d3fbc24
@@ -50,6 +50,10 @@ module Cloner::Postgres
50
50
  ""
51
51
  end
52
52
 
53
+ def pg_bin_path(util)
54
+ util
55
+ end
56
+
53
57
  def pg_dump_remote
54
58
  puts "backup remote DB via ssh"
55
59
  do_ssh do |ssh|
@@ -58,7 +62,7 @@ module Cloner::Postgres
58
62
  check_ssh_err(ret)
59
63
  host = ar_r_conf['host'].present? ? " -h #{e ar_r_conf['host']}" : ""
60
64
  port = ar_r_conf['port'].present? ? " -p #{e ar_r_conf['port']}" : ""
61
- dump = pg_remote_auth + "pg_dump -Fc #{pg_dump_extra} -U #{e ar_r_conf['username']}#{host}#{port} #{e ar_r_conf['database']} > #{e(remote_dump_path + '/tmp.bak')}"
65
+ dump = pg_remote_auth + "#{pg_bin_path 'pg_dump'} -Fc #{pg_dump_extra} -U #{e ar_r_conf['username']}#{host}#{port} #{e ar_r_conf['database']} > #{e(remote_dump_path + '/tmp.bak')}"
62
66
  puts dump if verbose?
63
67
  ret = ssh_exec!(ssh, dump)
64
68
  check_ssh_err(ret)
@@ -69,7 +73,7 @@ module Cloner::Postgres
69
73
  puts "restoring DB"
70
74
  host = ar_conf['host'].present? ? " -h #{e ar_conf['host']}" : ""
71
75
  port = ar_conf['port'].present? ? " -p #{e ar_conf['port']}" : ""
72
- restore = pg_local_auth + "pg_restore --no-owner -Fc -c -U #{e ar_conf['username']}#{host}#{port} -d #{e ar_to} #{e(pg_path + '/tmp.bak')}"
76
+ restore = pg_local_auth + "#{pg_bin_path 'pg_restore'} --no-owner -Fc -c -U #{e ar_conf['username']}#{host}#{port} -d #{e ar_to} #{e(pg_path + '/tmp.bak')}"
73
77
  puts restore if verbose?
74
78
  pipe = IO.popen(restore)
75
79
  while (line = pipe.gets)
@@ -1,4 +1,4 @@
1
1
  module Cloner
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv