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"
    }
    
  6. in terminal, npm run cover to see the test coverage by istanbul
  7. Create your heroku app via dashboard
  8. Create github repo on Github.
  9. On your CLI, git init and git remote add origin your-url
  10. 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)
      
  11. Push to github and watch the build on Code Ship!

results matching ""

    No results matching ""