orchestration 0.4.13 → 0.4.14
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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d8603abb707884b67824a5f71c402bff863e53a812be3172cfeb4e9229d448d5
|
|
4
|
+
data.tar.gz: 9b7cc45a5c9abec3fec6b6e09101dd8f04c9c1dbf54ce7e0b280942345fe5a6d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d51f959f91e6d740fa6491037561364035ec489131003877f973a1ce3827c1baba24e96f533cbce9e146b5fd30b89e8b8d0b79aec81e543d26f0b27d7711f6c6
|
|
7
|
+
data.tar.gz: a59cf9b833da91425f07c4cc798e2f0949a6fe01ff06f77fed9bfb5c1bce8f2c7f4b97f2b9f2d562d0cd5f262b43a3291cc66e7293d282bff6ffaa90f9a7b2e7
|
data/README.md
CHANGED
|
@@ -45,16 +45,24 @@ module Orchestration
|
|
|
45
45
|
def port
|
|
46
46
|
return @env.app_port if @service_name == 'app'
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.fetch('ports')
|
|
52
|
-
.first
|
|
53
|
-
.partition(':')
|
|
48
|
+
service = @env.docker_compose_config
|
|
49
|
+
.fetch('services')
|
|
50
|
+
.fetch(@service_name)
|
|
54
51
|
|
|
52
|
+
local, remote = parse_port(service)
|
|
55
53
|
(@env.environment == 'production' ? remote : local).to_i
|
|
56
54
|
end
|
|
57
55
|
|
|
56
|
+
def parse_port(service)
|
|
57
|
+
# Remove our sidecar variable for easier parsing
|
|
58
|
+
# '{sidecar-27018:}27017' => '27018:27017'
|
|
59
|
+
local, _, remote = service.fetch('ports')
|
|
60
|
+
.first
|
|
61
|
+
.sub(/\${sidecar-(\d+):}/, '\1:')
|
|
62
|
+
.partition(':')
|
|
63
|
+
[local, remote]
|
|
64
|
+
end
|
|
65
|
+
|
|
58
66
|
def yaml(content)
|
|
59
67
|
# Whitelist `Symbol` and permit aliases:
|
|
60
68
|
YAML.safe_load(content, [Symbol], [], true)
|
|
@@ -17,20 +17,18 @@ module Orchestration
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def host
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
super
|
|
20
|
+
from_url['host'] || super
|
|
23
21
|
end
|
|
24
22
|
|
|
25
23
|
def port
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
super
|
|
24
|
+
from_url['port'] || super
|
|
29
25
|
end
|
|
30
26
|
|
|
31
27
|
private
|
|
32
28
|
|
|
33
29
|
def from_url
|
|
30
|
+
return {} if @env.rabbitmq_url.nil?
|
|
31
|
+
|
|
34
32
|
uri = URI.parse(@env.rabbitmq_url)
|
|
35
33
|
{ 'host' => uri.host, 'port' => uri.port || 5672 }
|
|
36
34
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: orchestration
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.14
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bob Farrell
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-12-
|
|
11
|
+
date: 2019-12-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: database_url
|