Skip to content

Latest commit

 

History

History
38 lines (35 loc) · 1.15 KB

File metadata and controls

38 lines (35 loc) · 1.15 KB

Continuous Integration, Code Coverage & Deployment with Codeship

Local Git -> git push -> Github -> Code Ship -> run test, test pass -> Deploy to Heroku

  1. npm install -g istanbul to see code coverage
  2. Make sure tests are passing
  3. In app.js, add var port = process.env.PORT || 3000 make sure app.listen(port) at the bottom of app.js, module.exports = app
  4. In test file, include var app = require(../app)
  5. In package.json, include
"scripts": {
  "start" : "node app.js",
  "dev" : "nodemon app.js",
  "cover" : "istanbul cover _mocha"
}
  1. in terminal, npm run cover to see the test coverage by istanbul

  2. Create your heroku app via dashboard

  3. Create github repo on Github.

  4. On your CLI, git init and git remote add origin your-url

  5. create and configure Code Ship

    • Set up commands:
    nvm install 6.2.2
    npm install
    npm install -g mocha
    npm install -g istanbul
    npm install -g codeclimate-test-reporter
    
    • Test pipelines
    npm run cover
    CODECLIMATE_REPO_TOKEN if you're using codeclimate (copy from codeclimate)
    
  6. Push to github and watch the build on Code Ship!