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 +4 -4
- data/lib/cloner/postgres.rb +6 -2
- data/lib/cloner/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16802f5e33d2ec7ee1125de6181c768acf050e05
|
4
|
+
data.tar.gz: 102b5732b777d4aa5c2a36d9cfed1be97dcf4be6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed39fa7e86356730b021924cda9e07f040e9e1108bfa57b32aa78eb9e26d6da82b65a99a6504c29a04ba53b198497bb2e48ccc4aa89e7c1356c4f5c438ebc13b
|
7
|
+
data.tar.gz: 999f75fb8d067c7470ccb1d7f35a5a6511b1058bafa0c9d6d6b83bbe7357766af7b1a5f7f8c5a6944d59b12319283ee1cf6ae80c390e49a076089b753d3fbc24
|
data/lib/cloner/postgres.rb
CHANGED
@@ -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)
|
data/lib/cloner/version.rb
CHANGED