spurious-server 0.4.1 → 0.5.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: ec3cb84c415fb42853c7c4e72740d24ce2945381
4
- data.tar.gz: d5a99a5a1d3c8b5dbcd9d0be9c72c95faf2484a4
3
+ metadata.gz: a78a870b1812bb3c048ea34b731c1fc737922f26
4
+ data.tar.gz: f2d9fa79559f110eadee3a47c99208e46fea7e47
5
5
  SHA512:
6
- metadata.gz: 2faf22e7728e255fa26c08513b2b36249b49b73460913bf685776f28c5b112f1a1f33721f0ea9540a669fd259d04df62f7a80c587b56257e5e56d9d1eac4e540
7
- data.tar.gz: caa82893f6ebf0631a2efc86c7833f3897c21c5b206168522c0bfd99a39de3e5312434eb318a35f01a2791b50d965fab280baa5498cdf81a470879c3f5eacfd5
6
+ metadata.gz: 1a7964dfafa370163e54c93a5c8371a24f2d59b684afd825eda7c06c470a8e38900c6a6041005d7d4bac1bc30b43016ef81267fcb06332d29c5c50cbd88c57db
7
+ data.tar.gz: a956d37ef07aac7b88b855df2a090009b401415d27493df87a98e4126b4fb30f5011d982aa31c27e54e02709965d062dbaeff25c07e418b193022b044f88ad66
data/config/images.yaml CHANGED
@@ -1,26 +1,37 @@
1
1
  'spurious-sqs':
2
- :image: 'smaj/spurious-sqs'
2
+ :image: 'spurious/sqs'
3
+ :hostname: 'sqs.spurious.localhost'
3
4
 
4
5
  'spurious-s3':
5
- :image: 'smaj/spurious-s3'
6
+ :image: 'spurious/s3'
7
+ :hostname: 's3.spurious.localhost'
6
8
 
7
9
  'spurious-dynamo':
8
- :image: 'smaj/spurious-dynamo'
10
+ :image: 'spurious/dynamodb'
11
+ :hostname: 'dynamodb.spurious.localhost'
9
12
 
10
13
  'spurious-memcached':
11
14
  :image: 'smaj/memcached'
12
15
 
13
16
  'spurious-elasticache':
14
- :image: 'smaj/fake-elasticache'
17
+ :image: 'spurious/elasticache'
15
18
  :link:
16
19
  - 'spurious-memcached:memcached01'
17
20
  :env:
18
21
  FAKEELASTICACHE_DEFAULT_HOST: '127.0.0.1'
19
22
 
20
23
  'spurious-elasticache-docker':
21
- :image: 'smaj/fake-elasticache'
24
+ :image: 'spurious/elasticache'
22
25
  :ignore:
23
26
  :create: true
24
27
  :delete: true
25
28
  :link:
26
29
  - 'spurious-memcached:memcached01'
30
+
31
+ 'spurious-browser':
32
+ :image: 'spurious/browser'
33
+ :link:
34
+ - 'spurious-dynamo:dynamodb.spurious.localhost'
35
+ - 'spurious-sqs:sqs.spurious.localhost'
36
+ - 'spurious-s3:s3.spurious.localhost'
37
+ :hostname: 'browser.spurious.localhost'
@@ -33,8 +33,8 @@ module Spurious
33
33
  end
34
34
  container_cmd = []
35
35
 
36
- if meta[:image] == 'smaj/spurious-s3'
37
- container_cmd = ['-h', docker_host]
36
+ if meta[:image] == 'spurious/s3'
37
+ container_cmd = ['-H', meta[:hostname]]
38
38
  end
39
39
 
40
40
  create_container = Proc.new do
@@ -62,7 +62,10 @@ module Spurious
62
62
  end
63
63
 
64
64
  def operation_complete(complete)
65
- send("6 containers successfully initialized", :info, true, :green) if complete
65
+ if complete
66
+ send("#{app_config.length} containers successfully initialized", :info, false, :green)
67
+ send("Please add the following to your /etc/hosts file:\n\n#{docker_host} sqs.spurious.localhost s3.spurious.localhost dynamodb.spurious.localhost browser.spurious.localhost\n", :info, true, :blue)
68
+ end
66
69
  end
67
70
 
68
71
  end
@@ -17,15 +17,17 @@ module Spurious
17
17
  def execute!
18
18
  ports = {}
19
19
  spurious_containers.peach do |container|
20
+ a_config = app_config[container.json['Name'].gsub('/', '')]
20
21
  config = container_config(container.json["Name"])
21
22
  ports[sanitize(container.json["Name"])] = []
22
23
 
23
24
  if !container.json["NetworkSettings"]["Ports"].nil? then
25
+ host = a_config
24
26
 
25
27
  container.json["NetworkSettings"]["Ports"].each do |guest, mapping|
26
28
  mapping.each do |map|
27
29
  ports[sanitize(container.json["Name"])] << {
28
- :Host => docker_host_ip,
30
+ :Host => a_config.fetch(:hostname, docker_host_ip),
29
31
  :HostPort => map["HostPort"]
30
32
  }
31
33
  end
@@ -35,8 +35,9 @@ module Spurious
35
35
  if container.json["Name"] == '/spurious-sqs' then
36
36
  port_setup = Proc.new do
37
37
  begin
38
+ container_config = app_config['spurious-sqs']
38
39
  port = container.json["NetworkSettings"]["Ports"]['4568/tcp'].first['HostPort']
39
- Net::HTTP.get(URI("http://#{docker_host_ip}:#{port}/host-details?host=#{docker_host_ip}&port=#{port}"))
40
+ Net::HTTP.get(URI("http://#{docker_host_ip}:#{port}/host-details?host=#{container_config[:hostname]}&port=#{port}"))
40
41
  rescue StandardError => e
41
42
  end
42
43
  end
@@ -1,5 +1,5 @@
1
1
  module Spurious
2
2
  module Server
3
- VERSION = "0.4.1"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_runtime_dependency "eventmachine"
26
26
  spec.add_runtime_dependency "em-synchrony"
27
- spec.add_runtime_dependency "docker-api"
27
+ spec.add_runtime_dependency "docker-api", "1.13.6"
28
28
  spec.add_runtime_dependency "daemons"
29
29
  spec.add_runtime_dependency "peach"
30
30
 
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.4.1
4
+ version: 0.5.0
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-11-02 00:00:00.000000000 Z
11
+ date: 2015-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: docker-api
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: 1.13.6
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: 1.13.6
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: daemons
99
99
  requirement: !ruby/object:Gem::Requirement