Dan Markhasin Dan Markhasin - 1 year ago 295
Node.js Question

TeamCity + Node.JS Continuous Deployment

We are currently trying to setup a CI/CD pipeline for several NodeJS projects that we are developing (mostly based on the Sails.JS framework).

I've successfully setup TeamCity and a Build Agent and created a simple build configuration that basically just does npm install, and the next step we want to take is to setup continuous delivery of successful builds to our Dev (and eventually Prod) servers.

However, there seems to be very little information online regarding using TeamCity for continuous delivery, and most of the stuff I found relates to .NET projects and IIS using MSDeploy, which (to the best of my understanding) won't really work for us.

I was thinking of writing a set of custom scripts that would copy the build files to the Dev server, restart the service, etc. but I'm not sure how the build is supposed to interact with these scripts (for example, how to get the path where the project has been built?).

Does anyone have experience with setting up TeamCity to deploy NodeJS code (or any other non-.NET code for that matter) that can point me in the right direction?


Answer Source

I am not familiar with ThoughtWorks GO, but I managed to achieve what I needed by using the TeamCity Deployer plugin. For Linux it is rather simple (build, then SCP files to a staging folder on the server, then run remote script to merge whatever needs to be merged and restart any required services), but I'm still working on the Windows version.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download