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 +4 -4
- data/README.md +8 -0
- data/lib/armada/deploy_dsl.rb +5 -0
- data/lib/armada/docker/container.rb +2 -1
- data/spec/docker/container_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c6ee2bb0cf4d7683be0c8382e1eee0850a85752d
|
4
|
+
data.tar.gz: 7b66e9f9eb0e49402c14330d312e016af44ff634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/armada/deploy_dsl.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2015-01-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: excon
|