Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 2.49 KB

6_heroku_deployment.md

File metadata and controls

51 lines (34 loc) · 2.49 KB

Heroku Deployment

In this assignment, you'll deploy your database-driven application to Heroku.

Refer to the steps below. I also made a little video going through the process: https://vimeo.com/207720558

Pre-deployment

First, complete the following pre-deployment steps.

  1. Create a Heroku app called USERNAME-galvanize-bookshelf where USERNAME is your GitHub username in lowercase form.
  2. Generate a cryptographic key for the JWT signature and set it to the JWT_KEY config variable of the new Heroku app.
  3. Update the package.json file with a dependency to a specific Node.js version.
  4. Enable the Heroku PostgreSQL add-on for the new Heroku app.
  5. Update the knexfile.js file with the production database connection information.
  6. Update the package.json file with a heroku-postbuild script to migrate the production database.
  7. Remember that you have two choices for specifying what script to run to start your server: profile (https://devcenter.heroku.com/articles/getting-started-with-nodejs#define-a-procfile) or the start script in package.json (if no procfile is found). In this repo nodemon is devDependency which will not be included in the default heroku environment.
  8. Add and commit the changes to your local git repository.
  9. Push the changes to the master branch on GitHub.

Deployment

Next, complete the following deployment steps.

  1. Push the changes to the master branch on Heroku.
  2. Seed the production database with npm run knex seed:run as a one-off Heroku command.
  3. Visit the Heroku app at https://USERNAME-galvanize-bookshelf.herokuapp.com/.
  4. If the application isn't working, check the production logs with heroku logs.
  5. Otherwise, celebrate with a beverage of choice!

Post-deployment

Finally, complete the following post-deployment steps.

  1. Add https://USERNAME-galvanize-bookshelf.herokuapp.com/ to your Github repository's URL.
  2. Fix any test errors, including bonus tests, with npm test. Note that this at the moment can only be run in your local environment.
  3. Fix any linting errors with npm run lint ..
  4. Submit your solution for grading.

Bonus

Use the Heroku Scheduler add-on to seed the production database with npm run knex seed:run every hour.

Bonus

Once you're satisfied, find a classmate and see if that person would like some help.