Skip to content

11.0.0 Build and Deploy To Heroku

Patrick Baselier edited this page Nov 13, 2015 · 6 revisions

What you will learn

  • Build and deploy the application to Heroku

Before you start

See the installation instructions. Use tag 11.0.0. You also need to have an account with Heroku and have the Heroku Toolbelt for deploying the application.

Deploy the back end

This step is optional, you can instead connect to a different backend we've set up when deploying the front end.

  • In the terminal, enter heroku auth:login.
  • Enter your email and password.
  • Enter heroku create (or heroku create [be-name] if want don't want Heroku to come up with a name)
  • Remember the name of the app that Heroku returns:
Creating gentle-forest-1234... done, stack is cedar
https://gentle-forest-1234.herokuapp.com/ | git@heroku.com:gentle-forest-1234.git

Deploy to Heroku by pushing only the backend folder (Heroku expect the application to be at the root):

$ heroku git:remote -a [be-name, e.g. gentle-forest-1234]
$ git subtree push --prefix backend heroku master
$ heroku run rake db:reset

Deploy the front end

  • Enter heroku create --buildpack https://github.com/tonycoco/heroku-buildpack-ember-cli.git (or heroku create [fe-name] --buildpack https://github.com/tonycoco/heroku-buildpack-ember-cli.git if want don't want Heroku to come up with a name).
  • Remember the name of the app that Heroku returns:
Creating quiet-woodland-6789... done, stack is cedar
BUILDPACK_URL=https://github.com/tonycoco/heroku-buildpack-ember-cli.git
https://quiet-woodland-6789.herokuapp.com/ | git@heroku.com:quiet-woodland-6789.git
  • Deploy to Heroku by pushing only the frontend folder (Heroku expect the application to be at the root):
$ heroku git:remote -a [fe-name, e.g. quiet-woodland-8703]
$ git subtree push --prefix frontend heroku master
  • To connect to the proper backend, you set the API_URL config variable. If you deployed the backend in the previous paragraph use this, otherwise you can connect to a backend we've set up for you (https://ember2-workshop-backend.herokuapp.com):
$ heroku config:set API_URL=https://[be-name].herokuapp.com
$ heroku apps:open