cloner 0.6.0 → 0.6.1
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 +5 -5
- data/README.md +1 -1
- data/lib/cloner/postgres.rb +11 -3
- data/lib/cloner/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 4327a76f4dbae0a838b04277cf1dfc42e40bd493a6557453fe20dd094ae7a017
|
|
4
|
+
data.tar.gz: 4b80a4c1ca652c01ab173b1711b84862a806c2318c246d700bd4abf21fa96cc0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39f309d98f2cd91d9df01ed50a0805590f8272bbf3be16302ae12891e0b27982816d25be76da99e5c38930027c9c5b5db473e55ad21e4a6f4ef5375a7490de68
|
|
7
|
+
data.tar.gz: 7d2f51fc2ca8d95e509836970e1c74bdc5a1dba1a8a4f9da8b72361904b6ee86de67a59c0f322fcb75258879215c96198cf1c2bb9ebfe90b75944497b7686c45
|
data/README.md
CHANGED
data/lib/cloner/postgres.rb
CHANGED
|
@@ -31,11 +31,19 @@ module Cloner::Postgres
|
|
|
31
31
|
def pg_restore_param
|
|
32
32
|
"--no-owner -Fc -c"
|
|
33
33
|
end
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
def pg_bin_path(util)
|
|
36
36
|
util
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
def pg_local_bin_path(util)
|
|
40
|
+
pg_bin_path(util)
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def pg_remote_bin_path(util)
|
|
44
|
+
pg_bin_path(util)
|
|
45
|
+
end
|
|
46
|
+
|
|
39
47
|
def pg_dump_remote
|
|
40
48
|
puts "backup remote DB via ssh"
|
|
41
49
|
do_ssh do |ssh|
|
|
@@ -44,7 +52,7 @@ module Cloner::Postgres
|
|
|
44
52
|
check_ssh_err(ret)
|
|
45
53
|
host = ar_r_conf['host'].present? ? " -h #{e ar_r_conf['host']}" : ""
|
|
46
54
|
port = ar_r_conf['port'].present? ? " -p #{e ar_r_conf['port']}" : ""
|
|
47
|
-
dump = pg_remote_auth + "#{
|
|
55
|
+
dump = pg_remote_auth + "#{pg_remote_bin_path 'pg_dump'} #{pg_dump_param} -U #{e ar_r_conf['username']}#{host}#{port} #{e ar_r_conf['database']} > #{e(remote_dump_path + '/tmp.bak')}"
|
|
48
56
|
puts dump if verbose?
|
|
49
57
|
ret = ssh_exec!(ssh, dump)
|
|
50
58
|
check_ssh_err(ret)
|
|
@@ -55,7 +63,7 @@ module Cloner::Postgres
|
|
|
55
63
|
puts "restoring DB"
|
|
56
64
|
host = ar_conf['host'].present? ? " -h #{e ar_conf['host']}" : ""
|
|
57
65
|
port = ar_conf['port'].present? ? " -p #{e ar_conf['port']}" : ""
|
|
58
|
-
restore = pg_local_auth + "#{
|
|
66
|
+
restore = pg_local_auth + "#{pg_local_bin_path 'pg_restore'} #{pg_restore_param} -U #{e ar_conf['username']}#{host}#{port} -d #{e ar_to} #{e(pg_path + '/tmp.bak')}"
|
|
59
67
|
puts restore if verbose?
|
|
60
68
|
pipe = IO.popen(restore)
|
|
61
69
|
while (line = pipe.gets)
|
data/lib/cloner/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cloner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- glebtv
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
126
126
|
version: '0'
|
|
127
127
|
requirements: []
|
|
128
128
|
rubyforge_project:
|
|
129
|
-
rubygems_version: 2.
|
|
129
|
+
rubygems_version: 2.7.7
|
|
130
130
|
signing_key:
|
|
131
131
|
specification_version: 4
|
|
132
132
|
summary: Easily clone your production Mongoid database and files for local development
|