Skip to content

Writes a config/secrets.yml file with values injected via your custom JSON

License

Notifications You must be signed in to change notification settings

omarramos/opsworks_rails_secrets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

opsworks_rails_secrets

Rails 4.1 cookbook to inject the secrets.yml into the shared config folder.

To use just specify the secrets in the stack's custom JSON. Example:

{
  "secrets": {
    "app_shortname": {
      "production": {
        "my_secret": "my_secret_value",
        "nested": {
          "value1": "1",
          "value2": "2"
        }
      }
    }
  },

  "deploy": {
    "app_shortname": {
      "symlink_before_migrate": {
        "config/secrets.yml": "config/secrets.yml"
      }
    }
  }
}

Opsworks Set-Up

  • Add secrets, deploy_to, and symlink_before_migrate attributes to the stack's custom JSON as in the example above.
  • Associate the opsworks_rails_secrets::configure custom recipe with the Deploy event in your rails app's layer.

A deploy isn't necessary if you just want to update the custom configuration. Instead, update the stack's custom JSON, then choose to Run Command > execute recipes and enter opsworks_rails_secrets::configure into the Recipes to execute field. Executing the recipe will write an updated secrets.yml file and restart unicorn workers.

Copyright and License

(c) 2014 Omar Ramos, DigitalTree. See LICENSE for details.

Thanks

Special thanks to Joey Aghion for providing the base of this cookbook.

About

Writes a config/secrets.yml file with values injected via your custom JSON

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages