percheron 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 184231c68ed6ae113dd7f46af5290a523b098066
4
- data.tar.gz: f9abacfe6fb20d642faecd4719bd1a0294183158
3
+ metadata.gz: febfd28281497bcdac84631381e348032bdf5308
4
+ data.tar.gz: 3dce8fa1c163bc54d369463b239f9198d3233d74
5
5
  SHA512:
6
- metadata.gz: a08a95231a9a22eb805451da21768e17addb2da749778f59626ae4cee1b370e040051b7f6457549e18cd5efa247173716d8f120515405b04d2f6ba3254c6f5bc
7
- data.tar.gz: 90a61d02bcbb222e44837526803a2a1a0da12f9b9f0fbbd2eafba03eee861160fc3528bbfff50937ff7ce024569a99cd5402e35973e5786d1937f449f52c9563
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.debug "Container '#{container.name}' does not need to be recreated"
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
- create_or_recreate!
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!
@@ -40,23 +40,24 @@ module Percheron
40
40
  end
41
41
 
42
42
  def stop!(container_names: [])
43
- container_names = dependant_containers(container_names).reverse
44
- serial_processor(container_names) { |container| Actions::Stop.new(container).execute! }
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 = dependant_containers(container_names)
49
- serial_processor(container_names) { |container| Actions::Start.new(container, container.dependant_containers.values).execute! }
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 = dependant_containers(container_names).reverse
54
- serial_processor(container_names) { |container| Actions::Restart.new(container).execute! }
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 = dependant_containers(container_names)
59
- serial_processor(container_names) { |container| Actions::Create.new(container).execute! }
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
- serial_processor(container_names_final.uniq) do |container|
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) { |container| Actions::Purge.new(container).execute! }
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 dependant_containers(container_names)
139
+ def dependant_containers_for(container_names)
131
140
  container_names = filter_container_names(container_names)
132
141
 
133
142
  wip_list = []
@@ -1,3 +1,3 @@
1
1
  module Percheron
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp