Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular-cli build (ng build) on Teamcity

I hope someone has already done this. I am trying to set up a continuous build in teamcity for one my angular 2 project. After done some research and I have followed the steps as follows:

  1. Build Step1: installed the jonnyzzz.node plugin for the teamcity. (Now I can pick Node.js NPM from Runner type)
    npm commands: I added install command
  2. Build Step 2: Another Node.js NPM and npm commands: install -g angular-cli
    So far so good
  3. Now I wanted to build ng build as the third step and I am really stuck as I have no way to do this.

Any help would be appreciated.

Thank you.

like image 983
Ravimaran Avatar asked Dec 01 '16 21:12

Ravimaran


2 Answers

Rather than changing your package.json you can use the node.js NPM plugin and the run command:

run build

build it not a default command for NPM so you need the 'run build' which is mapped to ng build in default ng-cli package.json

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
},

See image

like image 97
tlaughlin Avatar answered Oct 18 '22 23:10

tlaughlin


In order to get ng build work from nodejs plugin for Team city, I have modified the package.json file. In start replace the value with "ng build". And from team city, npm build command will trigger the ng build command.

like image 28
Ravimaran Avatar answered Oct 19 '22 00:10

Ravimaran