percheron 0.6.2 → 0.6.3
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/percheron/actions/recreate.rb +1 -1
- data/lib/percheron/actions/start.rb +1 -9
- data/lib/percheron/stack.rb +22 -13
- data/lib/percheron/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: febfd28281497bcdac84631381e348032bdf5308
|
4
|
+
data.tar.gz: 3dce8fa1c163bc54d369463b239f9198d3233d74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1ec93761eae6aec601ffb80c6072182f956f240610d9b3277ec561360efa8c5360f61a841f0cfc1c6d857e0ed22d96683c176726f8591d307363232a5a435e4
|
7
|
+
data.tar.gz: 8019b9377222d367f8a4f3a0316860456829a503c0678e5b72e8928c35d9f3b347fffd6e4666971698f267ff73cbbd33bba5c785fd90b9696b5e050417a48a32
|
@@ -18,7 +18,7 @@ module Percheron
|
|
18
18
|
unless dockerfile_md5s_match?
|
19
19
|
$logger.warn "Container '#{container.name}' MD5's do not match, consider recreating (bump the version!)"
|
20
20
|
else
|
21
|
-
$logger.
|
21
|
+
$logger.info "Container '#{container.name}' does not need to be recreated"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -10,7 +10,7 @@ module Percheron
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def execute!
|
13
|
-
|
13
|
+
create! unless container.exists?
|
14
14
|
unless container.running?
|
15
15
|
start!
|
16
16
|
execute_post_start_scripts! unless container.post_start_scripts.empty?
|
@@ -22,18 +22,10 @@ module Percheron
|
|
22
22
|
|
23
23
|
attr_reader :container, :dependant_containers
|
24
24
|
|
25
|
-
def create_or_recreate!
|
26
|
-
container.exists? ? recreate! : create!
|
27
|
-
end
|
28
|
-
|
29
25
|
def create!
|
30
26
|
Create.new(container).execute!
|
31
27
|
end
|
32
28
|
|
33
|
-
def recreate!
|
34
|
-
Recreate.new(container).execute!
|
35
|
-
end
|
36
|
-
|
37
29
|
def start!
|
38
30
|
$logger.info "Starting '#{container.name}' container"
|
39
31
|
container.docker_container.start!
|
data/lib/percheron/stack.rb
CHANGED
@@ -40,23 +40,24 @@ module Percheron
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def stop!(container_names: [])
|
43
|
-
container_names =
|
44
|
-
|
43
|
+
container_names = dependant_containers_for(container_names).reverse
|
44
|
+
exec_on_dependant_containers_for(container_names) { |container| Actions::Stop.new(container).execute! }
|
45
45
|
end
|
46
46
|
|
47
47
|
def start!(container_names: [])
|
48
|
-
container_names =
|
49
|
-
|
48
|
+
container_names = dependant_containers_for(container_names)
|
49
|
+
exec_on_dependant_containers_for(container_names) { |container| Actions::Start.new(container, container.dependant_containers.values).execute! }
|
50
|
+
|
50
51
|
end
|
51
52
|
|
52
53
|
def restart!(container_names: [])
|
53
|
-
container_names =
|
54
|
-
|
54
|
+
container_names = dependant_containers_for(container_names)
|
55
|
+
exec_on_dependant_containers_for(container_names) { |container| Actions::Restart.new(container).execute! }
|
55
56
|
end
|
56
57
|
|
57
58
|
def create!(container_names: [])
|
58
|
-
container_names =
|
59
|
-
|
59
|
+
container_names = dependant_containers_for(container_names)
|
60
|
+
exec_on_dependant_containers_for(container_names) { |container| Actions::Create.new(container).execute! }
|
60
61
|
end
|
61
62
|
|
62
63
|
def recreate!(container_names: [], force_recreate: false, delete: false)
|
@@ -69,13 +70,14 @@ module Percheron
|
|
69
70
|
container_names_final += deps
|
70
71
|
end
|
71
72
|
|
72
|
-
|
73
|
-
Actions::Recreate.new(container, force_recreate: force_recreate, delete: delete).execute!
|
74
|
-
end
|
73
|
+
exec_on_dependant_containers_for(container_names_final.uniq) { |container| Actions::Recreate.new(container, force_recreate: force_recreate, delete: delete).execute! }
|
75
74
|
end
|
76
75
|
|
77
76
|
def purge!
|
78
|
-
serial_processor(filter_container_names)
|
77
|
+
serial_processor(filter_container_names) do |container|
|
78
|
+
Actions::Purge.new(container).execute!
|
79
|
+
$logger.info ''
|
80
|
+
end
|
79
81
|
end
|
80
82
|
|
81
83
|
def valid?
|
@@ -102,6 +104,13 @@ module Percheron
|
|
102
104
|
filter_containers(container_names).each { |_, container| yield(container) }
|
103
105
|
end
|
104
106
|
|
107
|
+
def exec_on_dependant_containers_for(container_names)
|
108
|
+
serial_processor(container_names) do |container|
|
109
|
+
yield(container)
|
110
|
+
$logger.info ''
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
105
114
|
def serial_processor(container_names)
|
106
115
|
exec_on_containers(container_names) do |container|
|
107
116
|
yield(container)
|
@@ -127,7 +136,7 @@ module Percheron
|
|
127
136
|
end
|
128
137
|
end
|
129
138
|
|
130
|
-
def
|
139
|
+
def dependant_containers_for(container_names)
|
131
140
|
container_names = filter_container_names(container_names)
|
132
141
|
|
133
142
|
wip_list = []
|
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.6.
|
4
|
+
version: 0.6.3
|
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-03-
|
11
|
+
date: 2015-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: clamp
|