Skip to content

Commit

Permalink
feat(docs): Deployment docs update (react-boilerplate#1173) (react-bo…
Browse files Browse the repository at this point in the history
…ilerplate#1177)

Made changes to Step 3 per the discussion in react-boilerplate#743, as well as some
grammar/formatting adjustments and an update to the buildpack version
mentioned in Step 2 (v91 is the latest stable)
  • Loading branch information
sethmcleod authored and mxstbr committed Nov 2, 2016
1 parent f719214 commit 6d11b54
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions docs/general/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@

## Heroku

### Easy 6-Step Deployment Process
### Easy 5-Step Deployment Process

*Step 1:* Create a Procfile with the following line: `web: npm run start:prod`. We are doing this because heroku runs `npm run start` by default, so we need this setting to override the default run command.
*Step 1:* Create a _Procfile_ with the following line: `web: npm run start:prod`. We do this because Heroku runs `npm run start` by default, so we need this setting to override the default run command.

*Step 2:* Install heroku's buildpack on your heroku app by running the following command: `heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v90 -a [your app name]`. Make sure to replace `#v90` with whatever the latest buildpack is which you can [find here](https://github.com/heroku/heroku-buildpack-nodejs/releases).
*Step 2:* Install the Node.js buildpack for your Heroku app by running the following command: `heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v91 -a [your app name]`. Make sure to replace `#v91` with whatever the latest buildpack is, which you can [find here](https://github.com/heroku/heroku-buildpack-nodejs/releases).

*Step 3:* Add this line to your Package.json file in the scripts area: `"postinstall": "npm run build:clean",`. This is because Heroku runs this as part of their build process (more of which you can [read about here](https://devcenter.heroku.com/articles/nodejs-support#build-behavior)). Then remove this line from your `package.json` file from the scripts area: `"prebuild": "npm run build:clean && npm run test",`, to avoid having Heroku try to run Karma in its dynamo.
*Step 3:* Add this line to your `package.json` file in the scripts area: `"heroku-postbuild": "npm run build",`. This is so Heroku can build your production assets when deploying (more of which you can [read about here](https://devcenter.heroku.com/articles/nodejs-support#heroku-specific-build-steps)). Then, adjust the _prebuild_ script in your `package.json` file so it looks like this: `"prebuild": "npm run build:clean",` to avoid having Heroku attempt to run Karma tests (which are unsupported with this buildpack).

*Step 4:* Have heroku build your static files when deploying. Add this line to your Package.json file in the scripts area: `"heroku-postbuild": "npm run build",`. ([read about heroku-postbuild here](https://devcenter.heroku.com/articles/nodejs-support#heroku-specific-build-steps)).
*Step 4:* Run `heroku config:set NPM_CONFIG_PRODUCTION=false` so that Heroku can compile the NPM modules included in your _devDependencies_ (since many of these packages are required for the build process).

*Step 5:* Run `heroku config:set NPM_CONFIG_PRODUCTION=false` so that Heroku can compile the NPM Modules included in your devDependencies (since many of these packages are required for the build process).

*Step 6:* Follow the standard Heroku deploy process at this point:
*Step 5:* Follow the standard Heroku deploy process:

1. `git add .`
2. `git commit -m 'Made some epic changes as per usual'`
Expand Down

0 comments on commit 6d11b54

Please sign in to comment.