percheron 0.7.14 → 0.7.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +11 -8
- data/lib/percheron/actions/create.rb +4 -3
- data/lib/percheron/actions/recreate.rb +5 -3
- data/lib/percheron/commands/recreate.rb +2 -1
- data/lib/percheron/stack.rb +2 -2
- data/lib/percheron/unit.rb +1 -2
- data/lib/percheron/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: a3d390c7370c3f9ed4da778a0c5bff35a0bb1a3e
|
4
|
+
data.tar.gz: db80598848ec004fcd08433c973a2c4df01fcfbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6072c3f0c9c2761014a1a2c53279cc08c43c7d48929a7bfb4ad80169a4a073b4eef9a351c5cd61d81fae61c9e8e5f8f8292796e8dd403f2182b0443f9709d6b4
|
7
|
+
data.tar.gz: 92733cea3b69b070ec201e61d01f35e14d6d426b39d6da4f07b90839a68bdfa577d2c13efc779baa65a898516f799139fc23be6ce3e2fc42d8bf17311ae406ec
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -123,17 +123,17 @@ stacks:
|
|
123
123
|
units:
|
124
124
|
- name: master
|
125
125
|
version: 1.0.0
|
126
|
-
docker_image:
|
127
|
-
start_args: "-
|
126
|
+
docker_image: gliderlabs/consul-server:0.5
|
127
|
+
start_args: [ "-bootstrap", "-client", "0.0.0.0", "-data-dir", "/data", "-ui-dir", "/ui" ]
|
128
128
|
ports:
|
129
129
|
- 8500:8500
|
130
130
|
- 8600:53/udp
|
131
131
|
- name: agent
|
132
132
|
version: 1.0.0
|
133
133
|
instances: 2
|
134
|
-
docker_image:
|
135
|
-
start_args: "-
|
136
|
-
|
134
|
+
docker_image: gliderlabs/consul-agent:0.5
|
135
|
+
start_args: [ "-join", "master" ]
|
136
|
+
dependent_unit_names:
|
137
137
|
- master
|
138
138
|
```
|
139
139
|
|
@@ -142,9 +142,12 @@ stacks:
|
|
142
142
|
```bash
|
143
143
|
percheron start consul-stack
|
144
144
|
|
145
|
-
I, [2015-
|
146
|
-
I, [2015-
|
147
|
-
I, [2015-
|
145
|
+
I, [2015-08-06T22:36:46.536424 #45026] INFO -- : Creating 'consul-stack:master' unit
|
146
|
+
I, [2015-08-06T22:36:46.851682 #45026] INFO -- : Starting 'consul-stack:master' unit
|
147
|
+
I, [2015-08-06T22:36:47.861800 #45026] INFO -- : Creating 'consul-stack:agent1' unit
|
148
|
+
I, [2015-08-06T22:36:48.221852 #45026] INFO -- : Starting 'consul-stack:agent1' unit
|
149
|
+
I, [2015-08-06T22:36:48.929909 #45026] INFO -- : Creating 'consul-stack:agent2' unit
|
150
|
+
I, [2015-08-06T22:36:49.378310 #45026] INFO -- : Starting 'consul-stack:agent2' unit
|
148
151
|
```
|
149
152
|
|
150
153
|
5) Show the status
|
@@ -46,14 +46,15 @@ module Percheron
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def host_config_options
|
49
|
-
{
|
49
|
+
config = {
|
50
50
|
'HostConfig' => {
|
51
51
|
'PortBindings' => port_bindings,
|
52
52
|
'Links' => unit.links,
|
53
|
-
'Binds' => unit.volumes
|
54
|
-
'Dns' => unit.dns
|
53
|
+
'Binds' => unit.volumes
|
55
54
|
}
|
56
55
|
}
|
56
|
+
config['Dns'] = unit.dns unless unit.dns.empty?
|
57
|
+
config
|
57
58
|
end
|
58
59
|
|
59
60
|
def options
|
@@ -4,14 +4,15 @@ module Percheron
|
|
4
4
|
|
5
5
|
include Base
|
6
6
|
|
7
|
-
def initialize(unit, start: false)
|
7
|
+
def initialize(unit, start: false, force: false)
|
8
8
|
@unit = unit
|
9
9
|
@start = start
|
10
|
+
@force = force
|
10
11
|
end
|
11
12
|
|
12
13
|
def execute!
|
13
14
|
results = []
|
14
|
-
if recreate?
|
15
|
+
if recreate? || force?
|
15
16
|
results << recreate!
|
16
17
|
results << start!
|
17
18
|
else
|
@@ -22,8 +23,9 @@ module Percheron
|
|
22
23
|
|
23
24
|
private
|
24
25
|
|
25
|
-
attr_reader :unit, :start
|
26
|
+
attr_reader :unit, :start, :force
|
26
27
|
alias_method :start?, :start
|
28
|
+
alias_method :force?, :force
|
27
29
|
|
28
30
|
def recreate?
|
29
31
|
!unit.versions_match? || !unit.dockerfile_md5s_match?
|
@@ -3,10 +3,11 @@ module Percheron
|
|
3
3
|
class Recreate < Abstract
|
4
4
|
|
5
5
|
default_create_parameters!
|
6
|
+
option([ '-f', '--force' ], :flag, 'Force purge and create', default: false)
|
6
7
|
|
7
8
|
def execute
|
8
9
|
super
|
9
|
-
stack.recreate!(unit_names: unit_names, start: start?)
|
10
|
+
stack.recreate!(unit_names: unit_names, start: start?, force: force?)
|
10
11
|
end
|
11
12
|
end
|
12
13
|
end
|
data/lib/percheron/stack.rb
CHANGED
@@ -79,8 +79,8 @@ module Percheron
|
|
79
79
|
execute!(Actions::Create, dependant_units_for(unit_names), start: start)
|
80
80
|
end
|
81
81
|
|
82
|
-
def recreate!(unit_names: [], start: false)
|
83
|
-
execute!(Actions::Recreate, filter_unit_names(unit_names), start: start)
|
82
|
+
def recreate!(unit_names: [], start: false, force: false)
|
83
|
+
execute!(Actions::Recreate, filter_unit_names(unit_names), start: start, force: force)
|
84
84
|
end
|
85
85
|
|
86
86
|
def purge!(unit_names: [], force: false)
|
data/lib/percheron/unit.rb
CHANGED
@@ -7,8 +7,7 @@ module Percheron
|
|
7
7
|
def_delegators :unit_config, :name, :pseudo_name, :docker_image
|
8
8
|
def_config_item_with_default :unit_config, [], :env, :ports, :volumes,
|
9
9
|
:dependant_unit_names, :pre_build_scripts,
|
10
|
-
:post_start_scripts, :start_args
|
11
|
-
def_config_item_with_default :unit_config, %w(127.0.0.1 8.8.8.8), :dns
|
10
|
+
:post_start_scripts, :start_args, :dns
|
12
11
|
def_config_item_with_default :unit_config, true, :startable
|
13
12
|
|
14
13
|
def initialize(config, stack, unit_name)
|
data/lib/percheron/version.rb
CHANGED