2

I have my package.json as below. I would like to trigger a bamboo build through npm scripts which should trigger npm install and then it should trigger npm run bamboo.

I am trying to make the build fail if my testcases fail.kindly help in how to configure in bamboo to achieve the same

"scripts": {
  "dev": "webpack",
  "prod": "webpack -p",
  "start": "webpack-dev-server --open",
  "build": "npm run clean-dist && npm run dev && npm run start",
  "pbuild": "npm run clean-dist && npm run prod && npm run start",
  "clean-dist": "rimraf ./dist && mkdir dist",
  "lint": "esw webpack.config.js app",
  "lint:watch": "npm run lint -- --watch",
  "test": "karma start --reporters html",
  "pro": "protractor protractor.config.js",
  "bamboo": "npm run clean-dist && npm run dev && npm run test"
}
RobC
  • 22,977
  • 20
  • 73
  • 80
Raphael
  • 1,738
  • 2
  • 27
  • 47

1 Answers1

2

In bamboo plan configuration:
1. Add new task
2. Select 'npm' type
3. Select Node.js executable - version of your nodeJs, installed on the server
4. Command: run test
This will run your 'test' script from package json

Igor Gonchar
  • 107
  • 1
  • 4