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.
Qorbani
source share