percheron 0.7.15 → 0.7.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/examples/consul/.percheron.yml +19 -0
- data/lib/percheron/graph.rb +24 -14
- data/lib/percheron/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b3358819570477f97ff3f4c1b21b689a7007390
|
4
|
+
data.tar.gz: 04f82dae87c48a51b0ebff986bf4bab889036c7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4cafe93d3bddf33b7098cdae3aa87afbe4a4a27d78f65b3e3a36c96808cd9867bbd2881a3a6499f7f334d97a1f8565402129117c93b32cbe32b04a44432005d0
|
7
|
+
data.tar.gz: 502ca1ee96c79cda8f55b347cb1b3ba30f61645374540a057143ea4b3b6ff0cca0ce06ab450f982e812a315ecd5798b9cd12ca6e1875a5fe4550af62485a8e85
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
stacks:
|
3
|
+
- name: consul-stack
|
4
|
+
description: A demo consul stack with one master and two agents
|
5
|
+
units:
|
6
|
+
- name: master
|
7
|
+
version: 1.0.0
|
8
|
+
docker_image: gliderlabs/consul-server:0.5
|
9
|
+
start_args: [ "-bootstrap", "-client", "0.0.0.0", "-data-dir", "/data", "-ui-dir", "/ui" ]
|
10
|
+
ports:
|
11
|
+
- 8500:8500
|
12
|
+
- 8600:53/udp
|
13
|
+
- name: agent
|
14
|
+
version: 1.0.0
|
15
|
+
instances: 2
|
16
|
+
docker_image: gliderlabs/consul-agent:0.5
|
17
|
+
start_args: [ "-join", "master" ]
|
18
|
+
dependent_unit_names:
|
19
|
+
- master
|
data/lib/percheron/graph.rb
CHANGED
@@ -33,24 +33,31 @@ module Percheron
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def graph_opts
|
36
|
-
{ type: :digraph, nodesep: 0.75, ranksep: 1.0, label: header_label
|
36
|
+
{ type: :digraph, nodesep: 0.75, ranksep: 1.0, label: header_label }
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
39
|
+
def header_label
|
40
|
+
'<
|
41
|
+
<table border="0" cellborder="0">
|
42
|
+
<tr><td height="36" valign="bottom">
|
43
|
+
<font face="Arial Bold" point-size="14">%s</font>
|
44
|
+
</td></tr>
|
45
|
+
<tr><td height="18"><font face="Arial Italic" point-size="11">%s</font></td></tr>
|
46
|
+
</table>
|
47
|
+
>' % [ stack.name, stack_description ]
|
41
48
|
end
|
42
49
|
|
43
|
-
def
|
44
|
-
|
50
|
+
def stack_description
|
51
|
+
stack.description || ' '
|
52
|
+
end
|
53
|
+
|
54
|
+
def units
|
55
|
+
@units ||= stack.units
|
45
56
|
end
|
46
57
|
|
47
58
|
def add_nodes
|
48
59
|
units.each do |_, unit|
|
49
|
-
|
50
|
-
add_pseudo_node(unit)
|
51
|
-
else
|
52
|
-
add_node(unit)
|
53
|
-
end
|
60
|
+
unit.pseudo? ? add_pseudo_node(unit) : add_node(unit)
|
54
61
|
end
|
55
62
|
end
|
56
63
|
|
@@ -70,14 +77,17 @@ module Percheron
|
|
70
77
|
end
|
71
78
|
|
72
79
|
def cluster_opts(unit)
|
73
|
-
|
80
|
+
label = '<<font face="Arial Bold">%s</font>>' % unit.pseudo_name
|
81
|
+
{ label: label, style: 'filled', color: 'lightgrey', fontsize: 13 }
|
74
82
|
end
|
75
83
|
|
76
84
|
def node_opts(unit)
|
77
85
|
shape = unit.startable? ? 'box' : 'ellipse'
|
78
|
-
label = [ unit.name ]
|
79
|
-
unit.ports.each
|
80
|
-
|
86
|
+
label = [ '<font face="Arial Bold" point-size="12">%s</font><br/>' % unit.name ]
|
87
|
+
unit.ports.each do |ports|
|
88
|
+
label << '<font point-size="11">p: %s, i: %s</font>' % ports.split(':')
|
89
|
+
end
|
90
|
+
{ shape: shape, label: '<%s>' % label.join('<br/>'), fontname: 'arial' }
|
81
91
|
end
|
82
92
|
|
83
93
|
def pseudo_node_opts(unit)
|
data/lib/percheron/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: percheron
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ash McKenzie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|
@@ -312,6 +312,7 @@ files:
|
|
312
312
|
- README.md
|
313
313
|
- Rakefile
|
314
314
|
- bin/percheron
|
315
|
+
- examples/consul/.percheron.yml
|
315
316
|
- lib/percheron.rb
|
316
317
|
- lib/percheron/actions.rb
|
317
318
|
- lib/percheron/actions/base.rb
|