momentum 0.0.6 → 0.0.7

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: 07fa3ea25f97bde202d9f8acec655b0368f1b506
4
- data.tar.gz: d9ceff35e20913d65d69dc60580184fea8c2828b
3
+ metadata.gz: 6efed5f99edf4fca126cc00c8a2a62d9992ec354
4
+ data.tar.gz: 30800b93629b9afec3e0b8559a7f32c73c06a743
5
5
  SHA512:
6
- metadata.gz: 75f121953e6b4ea15a3dcd6113d5639598a13c0807c31d14551e0f19e8328bd83cc6a0e01892f58b00580f5612ea670ce09d84acf5baa135d518151ecc4e694b
7
- data.tar.gz: 24f71286c888b889cb5fbb79f8fce6fb4814073dc0fc7a3d30077054f3bd3fc336916fcaef1c5786dbeac89f971d4338307400f85f4b835b184dc014222c3b12
6
+ metadata.gz: dea5f01cf73140243cf21a4c39a72a510931b4ab74e1b053fa2cec709b38e6cff8338286336e5b919c163807aee3abe0a04575401d57a6b3b5eb20914553534d
7
+ data.tar.gz: f02a956095e82edea0e976904439ca6694c68e8b17d55baafc4e32898daeb3557386b271bb16ba6927ff81fba29d5fa4d5b33d801a921a20a4c1826e00b9ba99
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Momentum
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: momentum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joey Aghion