docker-armada 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 42c150fa04f0e0b192a7448dfd2078e0864933d8
4
- data.tar.gz: 2dacba541fc78458bf0e8ca959c984b7ba7c1d7c
3
+ metadata.gz: e09a97ff289d801558221773a79b789b7dfe4470
4
+ data.tar.gz: 8588032a019f0a9202d245b2829020ee9c9efa60
5
5
  SHA512:
6
- metadata.gz: 6244a27c059b902ce09bcb4d33c65e25e1c31cd0e6e059de6b497bb2a69964f7b04cca951a2a0f7465a1d3802acf7cb6415a6d17dedc0871de7f68e8cf8b99db
7
- data.tar.gz: f393c42b0629b44935369e3c4099ba4412749c16f52713e9b30f2cb1dabf1f1bb6ba569224cf210ca0b8a5445de69152085f39a38db1d0a1584e96c82b72bd68
6
+ metadata.gz: afc28e67549fef69833e17fbb2ae5aae82f715afdb475d7e16ce20f817d6c33e750983e19d4f3a86d22b19eca77bf537391cbc5761dce0f134890f20ff45cdaf
7
+ data.tar.gz: fc5768eca420e28248590783f86611ce28fdfc81c3ec86df94f6267ff952d46e164b8f15ace9a590ea6f5ca151619f21894b8c387576b84ee09c3a4bff00debb
data/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  Armada is a docker deployment tool which we originally forked from the [NewRelic Centurion](https://github.com/newrelic/centurion) project. It has since seen a huge refactor occur where we started using the [swipely/docker-api](https://github.com/swipely/docker-api) gem for interacting with our docker hosts instead of the mix of docker-cli and api calls that Centurion makes. The DSL is largely unchanged as it works really well for our intended purposes.
9
9
 
10
10
  ## Disclaimer
11
- This gem is used in production for deployments at Rally Software. We like the structure it gives us and the simplicity of the DSL. If you feel that we are missing something please open an issue and let's have a discussion about it. If you find a bug please submit an issue and if possible a reproducible test case.
11
+ This gem is used in production for deployments at Rally Software. We like the structure it gives us and the simplicity of the DSL. If you feel that we are missing something please open an issue and let's have a discussion about it. If you find a bug please submit an issue and if possible a reproducible test case.
12
12
 
13
13
  ## Installation
14
14
 
@@ -153,12 +153,18 @@ Armada can perform a http health check for your application. There are 4 pieces
153
153
 
154
154
  **health_check_port will work even if you do not specify a contianer -> host port mapping. Armada will determine the dynamically assigned port to the expected container health check port and use that when performing the health check.**
155
155
 
156
- #### Raw Container Config
157
- If you want to use a docker feature not yet exposed through the armadafile, you can include a raw container config, and the rest of the armadafile will be applied on top of it.
156
+ #### Raw Create Container Config
157
+ If you want to use a create container docker feature not yet exposed through the armadafile, you can include a raw container config, and the rest of the armadafile will be applied on top of it.
158
158
 
159
159
  ```ruby
160
160
  container_config({ "Cmd" => [ "date" ] })
161
161
  ```
162
+ #### Raw Start Container Config
163
+ If you want to use a start container docker feature not yet exposed through the armadafile, you can include a raw start container config, and the rest of the armadafile will be applied on top of it.
164
+
165
+ ```ruby
166
+ start_config({ "VolumesFrom" => [ "other_container" ] })
167
+ ```
162
168
 
163
169
  ## CLI
164
170
  The CLI is written using [Thor](http://whatisthor.com/). Below is current commands that can be executed using the Armada gem.
@@ -266,7 +272,7 @@ This will remove all images that are considered "orphaned". This means they are
266
272
  ```bash
267
273
  bld-docker-01 -- unable to remove image 9d535e81db1e because of the following error - Expected([200, 201, 202, 203, 204, 304]) <=> Actual(409 Conflict)
268
274
  ```
269
- This is because it is not the parent image. We are working to resolve this problem. You may also have to run this command a few times to get all the images cleaned up.
275
+ This is because it is not the parent image. We are working to resolve this problem. You may also have to run this command a few times to get all the images cleaned up.
270
276
 
271
277
  Options:
272
278
  * `hosts` - The list of hosts you wish to perform this action against
@@ -132,6 +132,10 @@ module Armada::DeployDSL
132
132
  set(:container_config, cfg)
133
133
  end
134
134
 
135
+ def start_config(cfg)
136
+ set(:start_config, cfg)
137
+ end
138
+
135
139
  def privileged
136
140
  set(:privileged, true)
137
141
  end
@@ -55,7 +55,7 @@ module Armada
55
55
  end
56
56
 
57
57
  def self.create_host_config(options)
58
- host_config = {}
58
+ host_config = options[:start_config] || {}
59
59
  host_config['Binds'] = options[:binds] if options[:binds] && !options[:binds].empty?
60
60
  host_config['PortBindings'] = options[:port_bindings] if options[:port_bindings]
61
61
  host_config['PublishAllPorts'] = true
@@ -23,7 +23,9 @@ describe Armada::Container do
23
23
  "2222/udp" => [{"HostIp" => "0.0.0.0", "HostPort" => "2222"}]},
24
24
  :env_vars => { "KEY" => "VALUE" },
25
25
  :binds => [ "/host/log:/container/log" ],
26
- :restart_policy => { "MaximumRetryCount" => 5, "Name" => "always" }
26
+ :restart_policy => { "MaximumRetryCount" => 5, "Name" => "always" },
27
+ :container_config => { "CreateConfigKey" => "CreateConfigValue" },
28
+ :start_config => { "StartConfigKey" => "StartConfigValue" },
27
29
  }}
28
30
 
29
31
  describe "#stop" do
@@ -111,6 +113,7 @@ describe Armada::Container do
111
113
  it { should include("Volumes" => { "/container/log" => {}}) }
112
114
  it { should include("VolumesFrom" => "parent") }
113
115
  it { should include("RestartPolicy" => { "MaximumRetryCount" => 5, "Name" => "always" }) }
116
+ it { should include("CreateConfigKey" => "CreateConfigValue") }
114
117
  end
115
118
 
116
119
  describe ".create_host_config" do
@@ -119,6 +122,7 @@ describe Armada::Container do
119
122
  it { should include("PortBindings" => {"1111/tcp" => [{"HostIp" => "0.0.0.0", "HostPort" => "1111"}],
120
123
  "2222/udp" => [{"HostIp" => "0.0.0.0", "HostPort" => "2222"}]}) }
121
124
  it { should include("PublishAllPorts" => true) }
125
+ it { should include("StartConfigKey" => "StartConfigValue") }
122
126
  end
123
127
 
124
128
  end
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.1.0
4
+ version: 2.2.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: 2014-12-04 00:00:00.000000000 Z
13
+ date: 2014-12-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: excon