You can define a common shared key and use it with &label and <<: *label
common: &common secret_key_base: ... my_global_secret: foo development: <<: *common something_specific_to_development: ... test: <<: *common something_specific_to_test: ... production: <<: *common something_specific_to_production: ...
Update: for Rails 5.1 +
Rails 5.1 adds the shared key, which is automatically applied to all environments:
shared: # Everything nested under this key is automatically shared secret_key_base: ... my_global_secret: "foo" development: my_global_secret: "override value for dev" test: ...
user740584
source share