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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4445d20c93033c570134361013fe728e544003fd
4
- data.tar.gz: 10758084ea92c594af6fdb6f3e97ccb97bb5ff2d
3
+ metadata.gz: a3d390c7370c3f9ed4da778a0c5bff35a0bb1a3e
4
+ data.tar.gz: db80598848ec004fcd08433c973a2c4df01fcfbf
5
5
  SHA512:
6
- metadata.gz: 17d9f87847470b2b2fd05d5715bcbc2c191fabafd86b4171bdf5b47eca8e8568faa379bd0041e7d123e7ac035db69b48f05b6dbf09c497b6377184bd914dcbba
7
- data.tar.gz: be4a053a63c1c07206c5660ea8106cdb8549582ecd6e8fff713ed95149dee195a7adfb4345b51ff120f47e31960a3980565a0bf1616bc6bb3e0161d93edd384b
6
+ metadata.gz: 6072c3f0c9c2761014a1a2c53279cc08c43c7d48929a7bfb4ad80169a4a073b4eef9a351c5cd61d81fae61c9e8e5f8f8292796e8dd403f2182b0443f9709d6b4
7
+ data.tar.gz: 92733cea3b69b070ec201e61d01f35e14d6d426b39d6da4f07b90839a68bdfa577d2c13efc779baa65a898516f799139fc23be6ce3e2fc42d8bf17311ae406ec
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v0.7.15 / 2015-08-06
2
+
3
+ * Allow --force to be used when recreating
4
+ * Don't specify a default set of DNS servers
5
+ * Updated consul example in README
6
+
1
7
  ## v0.7.14 / 2015-08-06
2
8
 
3
9
  * When executing scripts, pass -x for more insight
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: progrium/consul:latest
127
- start_args: "-server -bootstrap -ui-dir /ui"
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: progrium/consul:latest
135
- start_args: "-server -join master"
136
- dependant_unit_names:
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-05-21T19:25:05.975964 #35449] INFO -- : Starting 'master' unit
146
- I, [2015-05-21T19:25:06.676782 #35449] INFO -- : Starting 'agent1' unit
147
- I, [2015-05-21T19:25:07.167997 #35449] INFO -- : Starting 'agent2' unit
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
@@ -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)
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Percheron
2
- VERSION = '0.7.14'
2
+ VERSION = '0.7.15'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: percheron
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.14
4
+ version: 0.7.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ash McKenzie