cloner 0.5.0 → 0.5.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 +4 -4
- data/lib/cloner/mongodb.rb +11 -4
- data/lib/cloner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ff039ecf77aa04b16d10b76f3ec8ec8dc494085d
|
|
4
|
+
data.tar.gz: 03534218c250e015f8f4ecc8d8f33d4cc6a7b610
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9b5605a4be19035cc327d101f8a35cb654d1bee6f859af0ece4eeacc694277b6bb761d4940e21c7f1af9630c453d4b26a7215bc82210b3bf7e2474e860f63c2
|
|
7
|
+
data.tar.gz: 76a975a0aa4083a9e78ee1a38aa8718f20979354bc9c99b4adb55e5eacee5a2e8e178f691eabaf2ddd975aaa77a78319289ebf967b7841780527b90c8f125b9a
|
data/lib/cloner/mongodb.rb
CHANGED
|
@@ -32,10 +32,12 @@ module Cloner::MongoDB
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
def mongodb_local_auth
|
|
35
|
-
if mongodb_conf['password'].
|
|
36
|
-
""
|
|
37
|
-
|
|
35
|
+
if mongodb_conf['options'].present? && mongodb_conf['password'].present?
|
|
36
|
+
"-u #{e mongodb_conf['options']['user']} -p #{e mongodb_conf['options']['password']}"
|
|
37
|
+
elsif mongodb_conf['password'].present?
|
|
38
38
|
"-u #{e mongodb_conf['username']} -p #{e mongodb_conf['password']}"
|
|
39
|
+
else
|
|
40
|
+
""
|
|
39
41
|
end
|
|
40
42
|
end
|
|
41
43
|
|
|
@@ -45,7 +47,12 @@ module Cloner::MongoDB
|
|
|
45
47
|
ssh.exec!("rm -R #{remote_dump_path}")
|
|
46
48
|
ret = ssh_exec!(ssh, "mkdir -p #{remote_dump_path}")
|
|
47
49
|
check_ssh_err(ret)
|
|
48
|
-
|
|
50
|
+
if mongodb_r_conf['options'].present? && mongodb_r_conf['options']['password'].present?
|
|
51
|
+
username, password = mongodb_r_conf['options']['user'], mongodb_r_conf['options']['password']
|
|
52
|
+
else
|
|
53
|
+
username, password = mongodb_r_conf['username'], mongodb_r_conf['password']
|
|
54
|
+
end
|
|
55
|
+
dump = "mongodump -u #{e username} -p #{e password} -d #{e mongodb_r_conf['database']} --authenticationDatabase #{e mongodb_r_conf['database']} -o #{e remote_dump_path}"
|
|
49
56
|
puts dump if verbose?
|
|
50
57
|
ret = ssh_exec!(ssh, dump)
|
|
51
58
|
check_ssh_err(ret)
|
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.5.
|
|
4
|
+
version: 0.5.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- glebtv
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: thor
|