Skip to content

Continuous Integration

Antony Budianto edited this page Jul 28, 2016 · 7 revisions

The starter supports Continuous integration and delivery pipeline by:

  • Installing only needed dependencies so it's faster and efficient
  • Run linting and unit test and will fail the build if one test failed or any error thrown
  • Build the production ready artifact

Prerequisites

  1. NodeJS and npm, using nvm is recommended
  2. Git
  3. Any CI servers (Jenkins, Travis, etc)

Getting started

  1. Clone or pull your project repository and change directory to there

  2. Install packages needed for production build

    npm install --production
  3. Finally run the build tasks

    npm run build

    It will run unit tests and if all passed, it will create the report folder and the artifact

  4. Now you can get the artifact in build folder and process it further (scan, delivery, deploy and etc.)

  • You don't need --production when NODE_ENV set to production
  • If neither --production and NODE_ENV = production is specified, then npm will install all dependencies including unneeded development dependencies!

Recommendation

  • Adjust your dependencies according to your project needs, so it can boost install time during build process
    • Moves all packages used only during development to devDependencies
  • Use gzip extension to compress your static assets

☀️ Support this starter by sharing it to your friends, giving stars, or pull requests! 😄

Clone this wiki locally