MrHello
MrHello

Reputation: 207

Figaro Gem - Declare a variable for 2 environment

I am using FIGARO with the application.yml file.

I would like to declare a variable for both environment, for exemple let's say:

development:
  COUCHBASE_URL: couch-1.io
test:
  COUCHBASE_URL: couch-1.io
production:
  COUCHBASE_URL: couch-2.io

how could I do something like that:

development, test:
  COUCHBASE_URL: couch-1.io

Do you know the correct way to do it ?

Thanks =)

Upvotes: 0

Views: 40

Answers (1)

karlingen
karlingen

Reputation: 14645

Use shared values:

defaults: &defaults
  COUCHBASE_URL: 'couch-1.io'

development:
  <<: *defaults
test:
  <<: *defaults

Now both environments would share the same variables defined under defaults

Upvotes: 2

Related Questions