centurion 1.8.1 → 1.8.2

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: 424cd7daf9560388d8fb53f54c2c98510657d0b6
4
- data.tar.gz: a01f26b380938f5f9f006ee00a1994666d9f2956
3
+ metadata.gz: b1dc375b0634eab02f89f0a78cd5eb7b4dbc3133
4
+ data.tar.gz: 342b3afcaac56fff384fab3d80b32d04ce87e09b
5
5
  SHA512:
6
- metadata.gz: c670495c7f4ab9c3f079efb7990edc482f941352ccaf43ed922abe9d816b788332c72579b4e45139aa32f9ae8c1d85c3e65c13613ff2490e248f6884a22fcfc0
7
- data.tar.gz: 4be2c2bd8c82e97585f75cb1a9e6761d3b1501414c45456c330d2a91c40f99017e554c6d53d7f0225d87708aeae305328a86726cb005b9c27e7668d15051d00f
6
+ metadata.gz: bcde80896ea6ed8e3bd5154d70c01360fae286810ecb38957b751a13a16cedd7cc01930e90087d4d400cebaddb299f843b086855336ad40ed141d2d5da67735c
7
+ data.tar.gz: 25de72a8c3f6511cd4b09336efe91311f347564d6d5d238393f34b436e75af40bccf9ab8f4978bf246460e9a75dd4bc1377521e3c32c8430b8522d94b8b26ba5
@@ -31,7 +31,7 @@ module Centurion::Deploy
31
31
  end
32
32
 
33
33
  unless health_check_method.call(target_server, port, endpoint)
34
- error "Failed to validate started container on #{target_server}:#{port}"
34
+ error "Failed to validate started container on #{target_server.hostname}:#{port}"
35
35
  exit(FAILED_CONTAINER_VALIDATION)
36
36
  end
37
37
  end
@@ -53,7 +53,7 @@ module Centurion::Deploy
53
53
  def http_status_ok?(target_server, port, endpoint)
54
54
  url = "http://#{target_server.hostname}:#{port}#{endpoint}"
55
55
  response = begin
56
- Excon.get(url, :headers => {'Accept' => '*/*'})
56
+ Excon.get(url, headers: {'Accept' => '*/*'})
57
57
  rescue Excon::Errors::SocketError
58
58
  warn "Failed to connect to #{url}, no socket open."
59
59
  nil
@@ -17,7 +17,7 @@ class Centurion::DockerRegistry
17
17
  path = "/v1/repositories/#{repository}/tags/#{tag}"
18
18
  uri = uri_for_repository_path(repository, path)
19
19
  $stderr.puts "GET: #{uri}"
20
- options = { :headers => { "Content-Type" => "application/json" } }
20
+ options = { headers: { "Content-Type" => "application/json" } }
21
21
  if @user
22
22
  options[:user] = @user
23
23
  options[:password] = @password
@@ -28,7 +28,7 @@ class Centurion::DockerViaApi
28
28
 
29
29
  response = Excon.get(
30
30
  @base_uri + path,
31
- tls_excon_arguments.merge(:headers => {'Accept' => 'application/json'})
31
+ tls_excon_arguments.merge(headers: {'Accept' => 'application/json'})
32
32
  )
33
33
  raise response.inspect unless response.status == 200
34
34
  JSON.load(response.body)
@@ -59,9 +59,9 @@ class Centurion::DockerViaApi
59
59
  response = Excon.post(
60
60
  @base_uri + path,
61
61
  tls_excon_arguments.merge(
62
- :query => name ? {:name => "#{name}-#{SecureRandom.hex(7)}"} : nil,
63
- :body => configuration.to_json,
64
- :headers => { "Content-Type" => "application/json" }
62
+ query: name ? {name: "#{name}-#{SecureRandom.hex(7)}"} : nil,
63
+ body: configuration.to_json,
64
+ headers: { "Content-Type" => "application/json" }
65
65
  )
66
66
  )
67
67
  raise response.inspect unless response.status == 201
@@ -73,8 +73,8 @@ class Centurion::DockerViaApi
73
73
  response = Excon.post(
74
74
  @base_uri + path,
75
75
  tls_excon_arguments.merge(
76
- :body => configuration.to_json,
77
- :headers => { "Content-Type" => "application/json" }
76
+ body: configuration.to_json,
77
+ headers: { "Content-Type" => "application/json" }
78
78
  )
79
79
  )
80
80
  case response.status
@@ -1,3 +1,3 @@
1
1
  module Centurion
2
- VERSION = '1.8.1'
2
+ VERSION = '1.8.2'
3
3
  end
@@ -127,6 +127,8 @@ namespace :deploy do
127
127
  container['Id'],
128
128
  port,
129
129
  fetch(:status_endpoint, '/'),
130
+ fetch(:image),
131
+ fetch(:tag),
130
132
  fetch(:rolling_deploy_wait_time, 5),
131
133
  fetch(:rolling_deploy_retries, 24)
132
134
  )
@@ -31,7 +31,7 @@ describe Centurion::DeployDSL do
31
31
  it 'adds new env_vars to the existing ones, as strings' do
32
32
  DeployDSLTest.env_vars('SHAKESPEARE' => 'Hamlet')
33
33
  DeployDSLTest.env_vars('DICKENS' => 'David Copperfield',
34
- :DICKENS_BIRTH_YEAR => 1812)
34
+ DICKENS_BIRTH_YEAR: 1812)
35
35
 
36
36
  expect(DeployDSLTest.defined_service.env_vars).to eq(
37
37
  'SHAKESPEARE' => 'Hamlet',
data/spec/deploy_spec.rb CHANGED
@@ -127,7 +127,7 @@ describe Centurion::Deploy do
127
127
  second_container = container.dup
128
128
  containers = [ container, second_container ]
129
129
 
130
- expect(server).to receive(:find_containers_by_public_port).with(80).and_return(containers)
130
+ expect(server).to receive(:find_containers_by_name).with(:centurion).and_return(containers)
131
131
  expect(server).to receive(:stop_container).with(container['Id'], 30).once
132
132
  expect(server).to receive(:stop_container).with(second_container['Id'], 30).once
133
133
 
@@ -93,7 +93,7 @@ describe Centurion::DockerRegistry do
93
93
  JSON
94
94
 
95
95
  before do
96
- expect(Excon).to receive(:get).with(kind_of(String), hash_including(:user => user, :password => password)).and_return(
96
+ expect(Excon).to receive(:get).with(kind_of(String), hash_including(user: user, password: password)).and_return(
97
97
  double(status: 200, body: response)
98
98
  )
99
99
  end
@@ -27,7 +27,7 @@ describe Centurion::DockerViaApi do
27
27
 
28
28
  it 'creates a container' do
29
29
  configuration_as_json = double
30
- configuration = double(:to_json => configuration_as_json)
30
+ configuration = double(to_json: configuration_as_json)
31
31
  expect(Excon).to receive(:post).
32
32
  with(excon_uri + "v1.10" + "/containers/create",
33
33
  query: nil,
@@ -39,10 +39,10 @@ describe Centurion::DockerViaApi do
39
39
 
40
40
  it 'creates a container with a name' do
41
41
  configuration_as_json = double
42
- configuration = double(:to_json => configuration_as_json)
42
+ configuration = double(to_json: configuration_as_json)
43
43
  expect(Excon).to receive(:post).
44
44
  with(excon_uri + "v1.10" + "/containers/create",
45
- query: { :name => match(/^app1-[a-f0-9]+$/) },
45
+ query: { name: match(/^app1-[a-f0-9]+$/) },
46
46
  body: configuration_as_json,
47
47
  headers: {'Content-Type' => 'application/json'}).
48
48
  and_return(double(body: json_string, status: 201))
@@ -51,7 +51,7 @@ describe Centurion::DockerViaApi do
51
51
 
52
52
  it 'starts a container' do
53
53
  configuration_as_json = double
54
- configuration = double(:to_json => configuration_as_json)
54
+ configuration = double(to_json: configuration_as_json)
55
55
  expect(Excon).to receive(:post).
56
56
  with(excon_uri + "v1.10" + "/containers/12345/start",
57
57
  body: configuration_as_json,
@@ -148,7 +148,7 @@ describe Centurion::DockerViaApi do
148
148
 
149
149
  it 'creates a container' do
150
150
  configuration_as_json = double
151
- configuration = double(:to_json => configuration_as_json)
151
+ configuration = double(to_json: configuration_as_json)
152
152
  expect(Excon).to receive(:post).
153
153
  with(excon_uri + 'v1.10/containers/create',
154
154
  client_cert: '/certs/cert.pem',
@@ -162,7 +162,7 @@ describe Centurion::DockerViaApi do
162
162
 
163
163
  it 'starts a container' do
164
164
  configuration_as_json = double
165
- configuration = double(:to_json => configuration_as_json)
165
+ configuration = double(to_json: configuration_as_json)
166
166
  expect(Excon).to receive(:post).
167
167
  with(excon_uri + 'v1.10/containers/12345/start',
168
168
  client_cert: '/certs/cert.pem',
@@ -28,7 +28,7 @@ describe Centurion::DockerViaCli do
28
28
  it 'should print all chars when one thread is running' do
29
29
  expect(Centurion::Shell).to receive(:run_with_echo)
30
30
 
31
- allow(Thread).to receive(:list) {[double(:status => 'run')]}
31
+ allow(Thread).to receive(:list) {[double(status: 'run')]}
32
32
 
33
33
  docker_via_cli.pull('foo')
34
34
  end
@@ -36,7 +36,7 @@ describe Centurion::DockerViaCli do
36
36
  it 'should only print lines when multiple threads are running' do
37
37
  expect(Centurion::Shell).to receive(:run_without_echo)
38
38
 
39
- allow(Thread).to receive(:list) {[double(:status => 'run'), double(:status => 'run')]}
39
+ allow(Thread).to receive(:list) {[double(status: 'run'), double(status: 'run')]}
40
40
 
41
41
  docker_via_cli.pull('foo')
42
42
  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.1
4
+ version: 1.8.2
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: 2015-09-09 00:00:00.000000000 Z
23
+ date: 2015-09-22 00:00:00.000000000 Z
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: trollop