momentum 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/momentum/opsworks.rb +9 -0
- data/lib/momentum/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6efed5f99edf4fca126cc00c8a2a62d9992ec354
|
4
|
+
data.tar.gz: 30800b93629b9afec3e0b8559a7f32c73c06a743
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dea5f01cf73140243cf21a4c39a72a510931b4ab74e1b053fa2cec709b38e6cff8338286336e5b919c163807aee3abe0a04575401d57a6b3b5eb20914553534d
|
7
|
+
data.tar.gz: f02a956095e82edea0e976904439ca6694c68e8b17d55baafc4e32898daeb3557386b271bb16ba6927ff81fba29d5fa4d5b33d801a921a20a4c1826e00b9ba99
|
data/lib/momentum/opsworks.rb
CHANGED
@@ -53,8 +53,17 @@ module Momentum::OpsWorks
|
|
53
53
|
def self.load_from_stack(client, stack_name, app_name)
|
54
54
|
stack = Momentum::OpsWorks.get_stack(client, stack_name)
|
55
55
|
JSON.parse(stack[:custom_json])["custom_env"][app_name].tap do |config|
|
56
|
+
|
56
57
|
# Custom config from OpsWorks doesn't include RAILS_ENV, so add it.
|
57
58
|
config['RAILS_ENV'] = Momentum::OpsWorks.get_app(client, stack, app_name)[:attributes]['RailsEnv']
|
59
|
+
|
60
|
+
# Set MEMCACHE_SERVERS if memcached server configured
|
61
|
+
if (memcached_layer = Momentum::OpsWorks.get_layers(client, stack, ['memcached']).first) &&
|
62
|
+
(memcached_instance = Momentum::OpsWorks.get_online_instances(client, layer_id: memcached_layer[:layer_id]).first)
|
63
|
+
config['MEMCACHE_SERVERS'] = memcached_instance[:private_ip]
|
64
|
+
config['MEMCACHE_SERVERS_PUBLIC'] = Momentum::OpsWorks.get_instance_endpoint(memcached_instance)
|
65
|
+
end
|
66
|
+
|
58
67
|
end
|
59
68
|
end
|
60
69
|
|
data/lib/momentum/version.rb
CHANGED