Skip to content

mikamai/opsworks-dotenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

opsworks-dotenv

Configure the environment for you Rails application using OpsWorks, Chef and Dotenv

install

Add the Dotenv gem to your Gemfile

gem 'dotenv-rails'

run bundle

$ bundle

as soon as possible, load the environment through Dotenv

# application.rb
require File.expand_path('../boot', __FILE__)
require 'dotenv'
Dotenv.load

configure

In the OpsWorks stack dashboard click on stack Settings and supply your ENV configuration. For example:

{
  "deploy":{
    "app_name":{
      "symlink_before_migrate":{
        ".env" : ".env"
      },
      "app_env": {
        "YOUR_ENV_KEY": "KEY_VALUE",
        "ANOTHER_ENV_KEY": "SECOND_VALUE"
      }
    }
  }
}

The symlink_before_migrate key just tells OpsWorks to create a link to .env file in shared application folder into current, so it can be picked up by Rails.

You can now deploy your app and enjoy the ENV

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages