docker-armada 2.3.0 → 2.4.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: bb783c462e44e65ca207040db91d66cd7ba417ee
4
- data.tar.gz: 453509782c1f8231779fe20c042346a59bdabd2e
3
+ metadata.gz: c6ee2bb0cf4d7683be0c8382e1eee0850a85752d
4
+ data.tar.gz: 7b66e9f9eb0e49402c14330d312e016af44ff634
5
5
  SHA512:
6
- metadata.gz: 472d4bf640b73706ec4d754269b8f140ef14fdb268e2ccbeddd66177b8c90bbd5306510756ed2e9702f67e16570ae516dd66a0553c4a90424475bae1236fe1a0
7
- data.tar.gz: 44caed441fc25b01c071939a0a1bb17175cce22fe84b965c31f31cdf2a02c68a02330a3c086ee0ca8451882a56e2c1ab7934de4469ba3f8614c58689c36a12df
6
+ metadata.gz: 1f0618ce91e4b08b87691cbc36aeafaca2fabeccc044748b22d1f37a81bba0b57daf2aba84580a3b3b15bcd867dd215fb50ed804feb18f708692d05744a86de2
7
+ data.tar.gz: c665d63fa19b318ca8bcb4dc48c41798d137901adf9fb2e1a9aaefbfab4bfe30b09a8671af5943da179c67077c20db0953ec6e82721146490ea97e76a0658cd7
data/README.md CHANGED
@@ -110,6 +110,14 @@ Examples:
110
110
  host 'bld-docker-01:4243'
111
111
  ```
112
112
 
113
+ #### hostname - Set the hostname for the container
114
+ The `hostname` method takes 1 parameter which is a string container the hostname you wish to apply to the container being started. If you do not call `hostname` it will use the `host` value as the hostname.
115
+
116
+ Examples
117
+ ```ruby
118
+ hostname 'myhomename'
119
+ ```
120
+
113
121
  **You can call this method multiple times to specify multiple hosts**
114
122
 
115
123
  #### container_name - Override the container name
@@ -55,6 +55,7 @@ module Armada::DeployDSL
55
55
  def set_current_environment(environment)
56
56
  env[:current_environment] = environment
57
57
  env[environment] ||= {}
58
+ env_vars ENVIRONMENT: environment.to_s.downcase
58
59
  end
59
60
 
60
61
  def current_environment
@@ -84,6 +85,10 @@ module Armada::DeployDSL
84
85
  set(:hosts, current)
85
86
  end
86
87
 
88
+ def hostname(hostname)
89
+ set(:hostname, hostname)
90
+ end
91
+
87
92
  def localhost
88
93
  # DOCKER_HOST is like 'tcp://127.0.0.1:4243'
89
94
  docker_host_uri = URI.parse(ENV['DOCKER_HOST'] || "tcp://127.0.0.1")
@@ -65,9 +65,10 @@ module Armada
65
65
 
66
66
  def self.create_container_config(image_id, container_name, host, options = {})
67
67
  container_config = options[:container_config] || {}
68
+ options[:env_vars][:HOST] = host
68
69
 
69
70
  container_config['Image'] = image_id || options[:image]
70
- container_config['Hostname'] = host
71
+ container_config['Hostname'] = options[:hostname] || host
71
72
 
72
73
  if options[:port_bindings]
73
74
  container_config['ExposedPorts'] ||= {}
@@ -109,7 +109,7 @@ describe Armada::Container do
109
109
  it { should include("Hostname" => "hostname") }
110
110
  it { should include("name" => "some_container") }
111
111
  it { should include("ExposedPorts" => { "1111/tcp" => {}, "2222/udp" => {}}) }
112
- it { should include("Env" => ["KEY=VALUE"]) }
112
+ it { should include("Env" => ["KEY=VALUE", "HOST=hostname"]) }
113
113
  it { should include("Volumes" => { "/container/log" => {}}) }
114
114
  it { should include("VolumesFrom" => "parent") }
115
115
  it { should include("RestartPolicy" => { "MaximumRetryCount" => 5, "Name" => "always" }) }
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.3.0
4
+ version: 2.4.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-04 00:00:00.000000000 Z
13
+ date: 2015-01-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: excon