Skip to content

This chef cookbook writes custom app configuration values from the OpsWorks stack's custom JSON to a config/application.yml file for each app. The figaro gem can help load those values directly into the application's ENV.

License

Notifications You must be signed in to change notification settings

joeyAghion/opsworks_custom_env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This cookbook maintains a config/application.yml file in each respective app's deploy directory. E.g.:

FOO: "http://www.yahoo.com"
BAR: "1001"

Your application can then load its settings directly from this file, or use Figaro to automatically make these settings available in the app's ENV (recommended).

Expects attributes of the form:

{
  "custom_env": {
    "my_app": {
      "FOO": "http://www.yahoo.com",
      "BAR": "1001"
    },
    "your_app": {
      "BAZ": "99"
    }
  }
}

Note that, at the moment, only Unicorn/Nginx-style Rails apps are supported.

Opsworks Set-Up

The opsworks_custom_env::configure recipe should be added as a custom recipe to the Setup, Configure, and Deploy events.

A deploy is not necessary to update custom application environment values. Instead, update the Stack's custom JSON, then choose to Run Command > execute recipes and enter opsworks_custom_env::update into the Recipes to execute field. Executing this recipe will write an updated application.yml file and restart the unicorn workers.

About

This chef cookbook writes custom app configuration values from the OpsWorks stack's custom JSON to a config/application.yml file for each app. The figaro gem can help load those values directly into the application's ENV.

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published