Skip to content

Instantly share code, notes, and snippets.

@rkeppner
Last active January 11, 2016 05:36
Show Gist options
  • Select an option

  • Save rkeppner/0a8249659d3e3a7c2f31 to your computer and use it in GitHub Desktop.

Select an option

Save rkeppner/0a8249659d3e3a7c2f31 to your computer and use it in GitHub Desktop.
Setting Up to Use an Existing Heroku Environment on Your Local OS X Environment

Setting Up to Use an Existing Heroku Environment on Your Local OS X Environment

Scope

These directions are for setting up a single code repo on 2 servers, staging and production. This may not be the configuration for all projects.

Prerequisites

These directions assume that you have already been added as a collaborator to a Heroku environment. If not, you will need to be. You also need to have already configured your Laravel Homestead environment and checked out the codebase from the GitHub repo. Those directions are found elsewhere.

Step-by-Step Instructions

  1. If you haven't already done so, create an account at heroku.com.
  2. If you haven't done so previously, install the Heroku Toolbelt on your machine.
  3. Browse through the Heroku collaboration documentation (but don’t execute the command line commands given).
  4. Execute these commands in your local environment, to add the Heroku remotes for promotion:
  • cd ~/Code/russellkeppner.com
  • heroku git:remote -a russellkeppner-staging -r staging
  • heroku git:remote -a russellkeppner -r production
  • git config heroku.remote staging
  1. Make development code changes.
  2. Commit your changes to staging via Git (command line instructions given below, but this can also be done in SourceTree):
  • git add -A .
  • git commit -m "I built your site."
  • git push staging master
  1. Share/QA the results at: http://russellkeppner-staging.herokuapp.com
  2. When approved, promote the changes to production:
  • heroku pipelines:promote -r staging
  1. Double-check site at: http://russellkeppner.herokuapp.com
  2. Profit!

Notes

  1. Files specific to Heroku:
  • Procfile
    Directives for Heroku environment configuration.
  • nginx.conf
    Nginx configuration for the Heroku environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment