centurion 1.8.5 → 1.8.6

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: 54fb3e35e5c7be90b4d79745d899b8434157977f
4
- data.tar.gz: 13355844e36026541dd2d31a4d9ed2ac3c099dd7
3
+ metadata.gz: c0fb523720be00d82b11f8d0d1f0325151fe5f3e
4
+ data.tar.gz: daa9decd0a1fdc4e6200634f0e17d7ab211e572d
5
5
  SHA512:
6
- metadata.gz: de4a567728bf795ca5f9dff906b3a6ccf97607689a0bf1a1ccba31a30d0a8ecc3e825b2efa3118645087773896f0b9c592a2f8126e303e88c08082804482815d
7
- data.tar.gz: 0c9c70fe003c2eac325bc9b130371425e1e67429a2a45a6a43aee78828dcb218fd3f5dde3a785714d47e3b706e34c69f884e6f492de208915b75a4e3f0a841d6
6
+ metadata.gz: e6f76519a481cda1b8508463ceb7a6a40763ba00030a257411f93075ef6105762c943c3c266526444ca35a801cb465c12635407ed977846b5b24f39f8b2cd238
7
+ data.tar.gz: bdd443607ab68146bc235b21a66e563f42a4f04047d530f9730a06806033c4c9635523e92ce7d5f0bad87e5f4851fbeec04bcb19528a1008efc4d707793b8c48
data/.travis.yml CHANGED
@@ -1 +1,4 @@
1
1
  language: ruby
2
+ before_install:
3
+ - gem update
4
+ - gem install bundler
data/README.md CHANGED
@@ -292,6 +292,7 @@ You have to set the following keys:
292
292
 
293
293
  ```ruby
294
294
  task :production => :common do
295
+ set :tlsverify, true
295
296
  set :tlscacert, '/usr/local/certs/ca.pem'
296
297
  set :tlscert, '/usr/local/certs/ssl.crt'
297
298
  set :tlskey, '/usr/local/certs/ssl.key'
@@ -299,6 +300,8 @@ You have to set the following keys:
299
300
  end
300
301
  ```
301
302
 
303
+ Modify the paths as appropriate for your cert, ca, and key files.
304
+
302
305
  Deploying
303
306
  ---------
304
307
 
@@ -549,6 +552,10 @@ Contributions are more than welcome. Bug reports with specific reproduction
549
552
  steps are great. If you have a code contribution you'd like to make, open a
550
553
  pull request with suggested code.
551
554
 
555
+ Note that PR's and issues are reviewed every ~2 weeks. If your PR or issue is
556
+ critical in nature, please reflect that in the description so that it receives
557
+ faster attention.
558
+
552
559
  Pull requests should:
553
560
 
554
561
  * Clearly state their intent in the title
@@ -568,4 +575,4 @@ patents, and ideas in that code in our products if we so choose. You also agree
568
575
  the code is provided as-is and you provide no warranties as to its fitness or
569
576
  correctness for any purpose
570
577
 
571
- Copyright (c) 2014-2015 New Relic, Inc. All rights reserved.
578
+ Copyright (c) 2014-2016 New Relic, Inc. All rights reserved.
data/bin/centurion CHANGED
@@ -60,7 +60,7 @@ set :name, opts[:project].gsub(/_/, '-')
60
60
  # Override environment variables when specified
61
61
  if opts[:override_env]
62
62
  opts[:override_env].split(',').each do |envvar|
63
- key, value = envvar.split('=')
63
+ key, value = envvar.split('=', 2)
64
64
  env_vars(key => value)
65
65
  end
66
66
  end
@@ -8,8 +8,10 @@ module Centurion::Deploy
8
8
 
9
9
  def stop_containers(target_server, service, timeout = 30)
10
10
  old_containers = if service.public_ports.nil? || service.public_ports.empty?
11
+ info "Looking for containers with names like #{service.name}"
11
12
  target_server.find_containers_by_name(service.name)
12
13
  else
14
+ info "Looking for containers listening on port #{service.public_ports.first}"
13
15
  target_server.find_containers_by_public_port(service.public_ports.first)
14
16
  end
15
17
 
@@ -54,6 +54,10 @@ module Centurion::DeployDSL
54
54
  set(:command, command)
55
55
  end
56
56
 
57
+ def ipc_mode(mode)
58
+ set(:ipc_mode, mode)
59
+ end
60
+
57
61
  def localhost
58
62
  # DOCKER_HOST is like 'tcp://127.0.0.1:2375'
59
63
  docker_host_uri = URI.parse(ENV['DOCKER_HOST'] || "tcp://127.0.0.1")
@@ -5,7 +5,7 @@ module Centurion
5
5
  class Service
6
6
  extend ::Capistrano::DSL
7
7
 
8
- attr_accessor :command, :dns, :extra_hosts, :image, :name, :volumes, :port_bindings, :network_mode, :cap_adds, :cap_drops
8
+ attr_accessor :command, :dns, :extra_hosts, :image, :name, :volumes, :port_bindings, :network_mode, :cap_adds, :cap_drops, :ipc_mode
9
9
  attr_reader :memory, :cpu_shares, :env_vars
10
10
 
11
11
  def initialize(name)
@@ -36,6 +36,7 @@ module Centurion
36
36
  s.command = fetch(:command, nil)
37
37
  s.memory = fetch(:memory, 0)
38
38
  s.cpu_shares = fetch(:cpu_shares, 0)
39
+ s.ipc_mode = fetch(:ipc_mode, nil)
39
40
 
40
41
  s.add_env_vars(fetch(:env_vars, {}))
41
42
  end
@@ -89,6 +90,10 @@ module Centurion
89
90
  @image = image
90
91
  end
91
92
 
93
+ def ipc_mode=(mode)
94
+ @ipc_mode = mode
95
+ end
96
+
92
97
  def build_config(server_hostname, &block)
93
98
  container_config = {}.tap do |c|
94
99
  c['Image'] = image
@@ -149,6 +154,9 @@ module Centurion
149
154
  # Set cpushare limits
150
155
  host_config['CpuShares'] = cpu_shares if cpu_shares
151
156
 
157
+ # Set ipc mode
158
+ host_config['IpcMode'] = ipc_mode if ipc_mode
159
+
152
160
  # Restart Policy
153
161
  if restart_policy
154
162
  host_config['RestartPolicy'] = {}
@@ -1,3 +1,3 @@
1
1
  module Centurion
2
- VERSION = '1.8.5'
2
+ VERSION = '1.8.6'
3
3
  end
@@ -46,7 +46,7 @@ describe Centurion::DeployDSL do
46
46
  expect(DeployDSLTest.defined_service.cap_adds).to eq(['IPC_LOCK'])
47
47
  end
48
48
 
49
- it 'adds multiple capabilites' do
49
+ it 'adds multiple capabilites' do
50
50
  DeployDSLTest.add_capability 'IPC_LOCK'
51
51
  DeployDSLTest.add_capability 'SYS_RESOURCE'
52
52
  expect(DeployDSLTest.defined_service.cap_adds).to eq(['IPC_LOCK', 'SYS_RESOURCE'])
@@ -63,12 +63,12 @@ describe Centurion::DeployDSL do
63
63
  expect(DeployDSLTest.defined_service.cap_drops).to eq(['IPC_LOCK'])
64
64
  end
65
65
 
66
- it 'drops multiple capabilites' do
66
+ it 'drops multiple capabilites' do
67
67
  DeployDSLTest.drop_capability 'IPC_LOCK'
68
68
  DeployDSLTest.drop_capability 'SYS_RESOURCE'
69
69
  expect(DeployDSLTest.defined_service.cap_drops).to eq(['IPC_LOCK', 'SYS_RESOURCE'])
70
70
  end
71
- end
71
+ end
72
72
 
73
73
  it 'adds hosts to the host list' do
74
74
  DeployDSLTest.set(:hosts, [ 'host1' ])
@@ -149,6 +149,13 @@ describe Centurion::DeployDSL do
149
149
  end
150
150
  end
151
151
 
152
+ describe '#ipc_mode' do
153
+ it 'accepts ipc host mode' do
154
+ DeployDSLTest.ipc_mode('host')
155
+ expect(DeployDSLTest.defined_service.ipc_mode).to eq('host')
156
+ end
157
+ end
158
+
152
159
  describe '#host_volume' do
153
160
  it 'raises unless passed the container_volume option' do
154
161
  expect { DeployDSLTest.host_volume('foo', {}) }.to raise_error(ArgumentError, /:container_volume/)
data/spec/service_spec.rb CHANGED
@@ -45,6 +45,11 @@ describe Centurion::Service do
45
45
  expect(service.cpu_shares).to eq(512)
46
46
  end
47
47
 
48
+ it 'has an ipc mode' do
49
+ service.ipc_mode = 'host'
50
+ expect(service.ipc_mode).to eq('host')
51
+ end
52
+
48
53
  it 'rejects non-numeric cpu shares' do
49
54
  expect(-> { service.cpu_shares = 'all' }).to raise_error
50
55
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: centurion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.5
4
+ version: 1.8.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Benders
@@ -20,7 +20,7 @@ authors:
20
20
  autorequire:
21
21
  bindir: bin
22
22
  cert_chain: []
23
- date: 2016-01-12 00:00:00.000000000 Z
23
+ date: 2016-04-01 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: trollop