Node.js and TeamCity

I have the following question:

In our company, we are launching a new web project with a large number of .js.css files. Our company is a Java company, which means that all development is done in: Java / Maven / Team City for the build process.

Since the company already uses TeamCity, we want to use it also for web builds, we are trying to introduce Node.js and GruntJs into our build process. I was wondering if anyone has experience configuring / configuring Node.js as a runner in TeamCity?

In the end, we want to β€œcommit” the change, and then build, this assembly will be performed using the Node.js runner. I found the following plugin for TeamCity.

Any help would be appreciated

+7
source share
1 answer

I use GruntJS and TeamCity in a web project that contains a couple of sites such as APIs, user and administrative portals, and Unit / Smock / Integration tests. After several prototypes, I finally decided to put all the logic in the ONE GruntJS file to create each part of the project separately.

To do this, I added one new project to the source deployment-only repository. Inside this project, I have my Gruntfile.js database, which is just an entry point for sub-Grunt build processes for each part of the project. I can pass the parameter to the Grunt-CLI base to select my build target, for example: grunt --target = api (Note: I also pass Version / Revision and other things, but for simplicity I no longer delve into this answer)

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

Thus, I get many advantages, such as:

  • Put all deployment logic in the source control for better maintainability.
  • Each developer has access to it and can build even on a local machine
  • TeamCity integration is so easy that you can easily move it to other CI platforms!

If you want to have each project in separate repositories, you can configure one Deployment repository with the base GruntJS and create submodules in other repositories.

+4
source

All Articles