docker-armada 2.4.0 → 2.5.0

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: c6ee2bb0cf4d7683be0c8382e1eee0850a85752d
4
- data.tar.gz: 7b66e9f9eb0e49402c14330d312e016af44ff634
3
+ metadata.gz: 3a2f5310391f2084d5d296b0b548998ec13af230
4
+ data.tar.gz: f44750dbb09b63886daeb448fe839e77ba1b9261
5
5
  SHA512:
6
- metadata.gz: 1f0618ce91e4b08b87691cbc36aeafaca2fabeccc044748b22d1f37a81bba0b57daf2aba84580a3b3b15bcd867dd215fb50ed804feb18f708692d05744a86de2
7
- data.tar.gz: c665d63fa19b318ca8bcb4dc48c41798d137901adf9fb2e1a9aaefbfab4bfe30b09a8671af5943da179c67077c20db0953ec6e82721146490ea97e76a0658cd7
6
+ metadata.gz: 16d255a647af783034fa5723711d94f0465b80b3e0fe0c8e6de6cce4eb480473a0c3649c7a9c4c91b60316e341b264109edcbbd633a19653708a1ced0219ac5a
7
+ data.tar.gz: 5cf9fee2ca6bcce102ed9b04c172ec08e59cfc5cce3c441b90a80db0c057f3dfd63e83bd1f097158d3e1f2a8d6d05f2cb5479a15179e802b2b51b1ef8cde22fe
data/README.md CHANGED
@@ -132,8 +132,8 @@ container_name 'myservice'
132
132
  You can add your own Docker Restart policy, see the [API documentation](https://docs.docker.com/reference/api/docker_remote_api_v1.15/#create-a-container)
133
133
 
134
134
  ```ruby
135
- restart_policy { "Name" => "always" }
136
- restart_policy { "Name" => "on-failure", "MaximumRetryCount" => 5 }
135
+ restart_policy({ "Name" => "always" })
136
+ restart_policy({ "Name" => "on-failure", "MaximumRetryCount" => 5 })
137
137
  ```
138
138
 
139
139
  #### Privileged containers
@@ -9,6 +9,10 @@ module Armada
9
9
  @name = options[:container_name]
10
10
  @container = docker_host.get_container(@name)
11
11
  @options = options
12
+
13
+ now_in_ns = Integer(Time.now.to_f * 1000000.0)
14
+ @options[:binds] ||= []
15
+ @options[:binds] << "/var/log/#{@name}-#{now_in_ns}:/var/log/service"
12
16
  end
13
17
 
14
18
  def stop
@@ -28,6 +28,16 @@ describe Armada::Container do
28
28
  :host_config => { "StartConfigKey" => "StartConfigValue" },
29
29
  }}
30
30
 
31
+ describe "#initialize" do
32
+ before { armada_container }
33
+
34
+ it "should have the log mount" do
35
+ expect(options[:binds]).not_to be_nil
36
+ expect(options[:binds].length).to equal 1
37
+ expect(options[:binds][0]).to match /^\/var\/log\/#{container_name}-\d+:\/var\/log\/service$/
38
+ end
39
+ end
40
+
31
41
  describe "#stop" do
32
42
  context "when the container exists" do
33
43
  before { docker_host.should_receive(:get_container).and_return(docker_container) }
@@ -110,7 +120,7 @@ describe Armada::Container do
110
120
  it { should include("name" => "some_container") }
111
121
  it { should include("ExposedPorts" => { "1111/tcp" => {}, "2222/udp" => {}}) }
112
122
  it { should include("Env" => ["KEY=VALUE", "HOST=hostname"]) }
113
- it { should include("Volumes" => { "/container/log" => {}}) }
123
+ it { should include("Volumes" => { "/container/log" => {} }) }
114
124
  it { should include("VolumesFrom" => "parent") }
115
125
  it { should include("RestartPolicy" => { "MaximumRetryCount" => 5, "Name" => "always" }) }
116
126
  it { should include("CreateConfigKey" => "CreateConfigValue") }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docker-armada
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Chauncey
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-01-13 00:00:00.000000000 Z
13
+ date: 2015-02-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: excon