spurious-server 0.3.0 → 0.3.1

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: 1cfbf2cf494c6d343c7d03ffd283fc256f27edc2
4
- data.tar.gz: 4b1c7df840777138786a87e9ee3b1c850b165691
3
+ metadata.gz: 19f55a1b5c6d49a367b38d3d562e2ca8c9598bc8
4
+ data.tar.gz: 8625d6c9b6401b5c48bbaaeb7d104db643dff8d8
5
5
  SHA512:
6
- metadata.gz: 20a74b83f99bb52d367892bd39a8436b9b1be5c4b5a70944a4e6eeeb90b1288c7cf4ecdc0875ff715affc23bf2d7920e0ce4f8ec4f065c4ac0762edcd4fa623c
7
- data.tar.gz: dcdcd072cb3705af6408c2b80ad4cb24730d45ade571855fc830b8c4efece1280115dbd43e0249be7267c5f993ec910305f945cf6e2581269897679b0c7a27b7
6
+ metadata.gz: 18d5128a1933f0c477fa36472f74f6f3a6d54419a414cda20a75f44d777158021f485873fd7a6ddf8d20f4b5d13c57f61d36a244eff8fc59d8a8f0c9be97aab1
7
+ data.tar.gz: b1b4637dbfa38ce2713a951fc75d8e4c00efc8c2e815d3c1b5de35a84a292a4689fda5712d3ef044940cacea640bc23549df50695551b8bef1eb50d5da01fd9c
@@ -14,7 +14,7 @@ module Spurious
14
14
  def self.create(type, connection, config, options)
15
15
  case type.to_sym
16
16
  when :init
17
- Init.new(connection, config)
17
+ Init.new(connection, config, options.docker_host)
18
18
  when :start
19
19
  Start.new(connection, config, options.docker_host)
20
20
  when :stop
@@ -8,7 +8,12 @@ module Spurious
8
8
  module State
9
9
  class Init < Base
10
10
 
11
- attr_accessor :completed_containers
11
+ attr_accessor :completed_containers, :docker_host
12
+
13
+ def initialize(connection, config, docker_host)
14
+ super(connection, config)
15
+ @docker_host = docker_host
16
+ end
12
17
 
13
18
  def execute!
14
19
  this = self
@@ -17,12 +22,17 @@ module Spurious
17
22
  app_config.each do |name, meta|
18
23
  image_meta = { 'fromImage' => meta[:image]}
19
24
  image_meta['Env'] = meta[:env] unless meta[:env].nil?
25
+ container_cmd = []
26
+
27
+ if meta[:image] == 'smaj/spurious-s3'
28
+ container_cmd = ['-h', docker_host]
29
+ end
20
30
 
21
31
  container_operation = Proc.new do
22
32
 
23
33
  begin
24
34
  this.send "Creating container with name: #{name}"
25
- Docker::Container.create("name" => name, "Image" => meta[:image])
35
+ Docker::Container.create("name" => name, "Image" => meta[:image], 'Cmd' => container_cmd)
26
36
  rescue Exception => e
27
37
  case e.message
28
38
  when /409 Conflict/
@@ -7,11 +7,11 @@ module Spurious
7
7
  module Server
8
8
  module State
9
9
  class Start < Base
10
- attr_accessor :docker_host_ip
10
+ attr_accessor :docker_host
11
11
 
12
- def initialize(connection, config, docker_host_ip)
12
+ def initialize(connection, config, docker_host)
13
13
  super(connection, config)
14
- @docker_host_ip = docker_host_ip
14
+ @docker_host = docker_host
15
15
  end
16
16
 
17
17
  def execute!
@@ -26,7 +26,7 @@ module Spurious
26
26
  if container.json["Name"] == '/spurious-sqs' then
27
27
  port_setup = Proc.new do
28
28
  port = container.json["NetworkSettings"]["Ports"]['4568/tcp'].first['HostPort']
29
- Net::HTTP.get(URI("http://#{docker_host_ip}:#{port}/host-details?host=#{docker_host_ip}&port=#{port}"))
29
+ Net::HTTP.get(URI("http://#{docker_host}:#{port}/host-details?host=#{docker_host}&port=#{port}"))
30
30
  end
31
31
 
32
32
  EM.add_timer(5) { EM.defer(port_setup) }
@@ -1,5 +1,5 @@
1
1
  module Spurious
2
2
  module Server
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spurious-server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-10 00:00:00.000000000 Z
11
+ date: 2014-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -168,7 +168,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
168
168
  version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
- rubygems_version: 2.0.3
171
+ rubygems_version: 2.0.14
172
172
  signing_key:
173
173
  specification_version: 4
174
174
  summary: The server component that the spurious cli client connects to