Node.js and TeamCity

I have the following question:

In our company we start a new web project, with a lot of .js .css files. Our company is a Java company, meaning all the development is done in: Java/Maven/Team City for build process.

Since the company is already using TeamCity, we want to use it also for the web build, we are trying to introduce Node.js and GruntJs in our build process. I was wondering if someone has experience of setting/configuration Node.js like a runner in TeamCity?

In the end we want to "commit" an change and then a build, this build will be done with the Node.js runner. I found the following plugin for TeamCity.

Any help will be appreciated


I'm using GruntJS and TeamCity in Web Project which contains couple of sites such as API, User and Admin portals, and Unit/Smock/Integration Tests. After couple of prototyping I finally decide to put all logic within ONE GruntJS file to build each part of project separately.

To do so, I added one new project to source repository just for deployment. Within that project then I have my base Gruntfile.js which is just entry point to sub-Grunt build processes for each part of project. I can pass parameter to base by Grunt-CLI to choose my target for build, like: grunt --target=api (Note: I also pass Version/Revision and other stuff too but for simplicity I don't go more in deep in this answer)

Then I created one shell script which run grunt with all possible parameters in sequence. And finally just created one step in build configuration in TeamCity to just run that shell script!

By doing this way I gain lots of benefits such as:

  • Put all deployment logic within source control for better maintainability.
  • Each developer have access to it and can build even on local machine
  • TeamCity integration become so simple and also you can easily move it to other CI platforms!
  • If you want to have each project on separated repositories, then you can setup one Deployment repository with base GruntJS and create submodules to other repositories.

    链接地址: http://www.djcxy.com/p/69920.html

    上一篇: 比numpy的in1d掩码函数做得更好:有序数组?

    下一篇: Node.js和TeamCity