Skip to content

Instantly share code, notes, and snippets.

@joncode
Last active January 12, 2017 23:18
Show Gist options
  • Save joncode/5594304 to your computer and use it in GitHub Desktop.
Save joncode/5594304 to your computer and use it in GitHub Desktop.
STAGING environment creation
1. make staging.rb in config/environments - copy production.rb for starters
2. in database.yml , application.yml , cloudinary.yml ... any .yml file , copy the production block and name it staging
2b. if you are using Resque - make a staging env in initializers/resque.rb
2c. add staging constants for any system-wide URLs
3. heroku create --remote staging <staging_app_name> --addons [any add ons here].
create the staging area of the config file
<staging_app_name> is the part of the url before '.herokuapp.com' -- muy importante , dont forget
4. heroku config:add RACK_ENV=staging RAILS_ENV=staging --remote staging
set up the rails environment vars
5. git push staging master
6. heroku run rake db:migrate --remote staging
7. RAILS 4 additions - if you have ...
group :production do
gem 'pg'
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
gem 'thin'
end
you must also have
group :staging do
gem 'pg'
gem 'rails_log_stdout', github: 'heroku/rails_log_stdout'
gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets'
gem 'thin'
end
for produciton ...
git push production master
heroku run rake db:migrate --remote production
you can build it to recognize gphm as going to staging automatically
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment