gitdis 0.0.1.1 → 0.0.2.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/README.md +22 -24
- data/VERSION +1 -1
- data/bin/gitdis +3 -2
- data/lib/gitdis.rb +1 -2
- 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: beade5f09d9ae75291929512a0167b15ed6d5ea3
|
4
|
+
data.tar.gz: 78f1b0232a334dc7f39d080ec33876950f31e83e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d481b7509a15999e8a0ccf734b30c24941f775d2c7670b8ae4bcf384f6ce578165ff585cce365eb3b579859d9636e6fa443f55811e19222b158ebc78a9c673e
|
7
|
+
data.tar.gz: b875da553b25546d218218a09fa8385e64d0321ecf2e1cd11effe15a317aff7896abe295c4fd200f17477bc62063018589f71021ce3f374fa6d05f317f894c80
|
data/README.md
CHANGED
@@ -18,40 +18,38 @@
|
|
18
18
|
|
19
19
|
### YAML Config
|
20
20
|
|
21
|
-
|
21
|
+
Toplevel keys are environments. `default` is required. Other environment
|
22
|
+
settings override defaults. 5 options, 1 keymap.
|
22
23
|
|
23
24
|
```
|
24
|
-
|
25
|
-
redis-
|
26
|
-
redis-
|
27
|
-
|
28
|
-
git-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
redis-host: qa.big.com
|
42
|
-
git-branch: develop
|
43
|
-
prod:
|
44
|
-
redis-host: secret.big.net
|
45
|
-
git-branch: master
|
25
|
+
default:
|
26
|
+
redis-host: localhost
|
27
|
+
redis-port: 6379
|
28
|
+
redis-db: 0
|
29
|
+
git-repo: ~/foo/bar/baz
|
30
|
+
git-branch: quux
|
31
|
+
keymap:
|
32
|
+
"redis:key:1": "path/to/file1"
|
33
|
+
"redis:key:2": "path/to/file2"
|
34
|
+
|
35
|
+
qa:
|
36
|
+
redis-host: qa.big.com
|
37
|
+
git-branch: develop
|
38
|
+
|
39
|
+
prod:
|
40
|
+
redis-host: secret.big.net
|
41
|
+
git-branch: master
|
46
42
|
```
|
47
43
|
|
44
|
+
See also https://github.com/rickhull/gitdis/tree/master/examples
|
45
|
+
|
48
46
|
### Command Line Options
|
49
47
|
|
50
48
|
Select your environment (optional). Add final overrides (optional).
|
51
49
|
|
52
50
|
```
|
53
51
|
Environment selection
|
54
|
-
-e, --environment
|
52
|
+
-e, --environment toplevel YAML key
|
55
53
|
Redis overrides
|
56
54
|
-H, --redis-host string
|
57
55
|
-p, --redis-port number
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2.1
|
data/bin/gitdis
CHANGED
@@ -7,7 +7,7 @@ require 'gitdis'
|
|
7
7
|
opts = Slop.parse { |o|
|
8
8
|
o.banner = "USAGE: gitdis path/to/config.yaml [options]"
|
9
9
|
o.separator ' Environment selection'
|
10
|
-
o.string '-e', '--environment', '
|
10
|
+
o.string '-e', '--environment', 'toplevel YAML key'
|
11
11
|
o.separator ' Redis overrides'
|
12
12
|
o.string '-H', '--redis-host', 'string'
|
13
13
|
o.integer '-p', '--redis-port', 'number'
|
@@ -66,12 +66,13 @@ redis_options = {}
|
|
66
66
|
}
|
67
67
|
puts "Redis options: #{redis_options}"
|
68
68
|
|
69
|
-
#
|
69
|
+
# process keymap
|
70
70
|
if opts.dump?
|
71
71
|
GitDis.dump(keymap.keys, redis_options)
|
72
72
|
else
|
73
73
|
gd = GitDis.new config.fetch('git-repo')
|
74
74
|
gd.git_pull config.fetch('git-branch')
|
75
|
+
|
75
76
|
keymap.each { |key, fileglob|
|
76
77
|
result = gd.update(key, fileglob)
|
77
78
|
case result
|
data/lib/gitdis.rb
CHANGED
@@ -42,11 +42,10 @@ class GitDis
|
|
42
42
|
val = redis.get(rkey)
|
43
43
|
if val and val.include?("\n")
|
44
44
|
val = "\n" << val.split("\n").map { |line| "\t#{line}" }.join("\n")
|
45
|
+
puts ["[#{rkey}]", val].join(' ')
|
45
46
|
end
|
46
|
-
puts ["[#{rkey}]", val].join(' ')
|
47
47
|
}
|
48
48
|
}
|
49
|
-
redis.disconnect
|
50
49
|
end
|
51
50
|
|
52
51
|
attr_accessor :repo_dir, :redis
|