Team Services | TFS 2017 | TFS 2015 | Previous versions (XAML builds)
Are you new to Team Build, Release Management, or CI/CD? If so, we recommend that you first read CI/CD for newbies and then come back here after that.
Here we'll show you how to define a continuous integration (CI) build process for your Node.js app. If you want to also continuously deploy (CD) your app to Azure, you'll be set up to make that happen after you're done creating this CI build process.
Upload your code
Do you have your own code?
No: Upload the sample app to Visual Studio Team Services (Team Services) or your on-premises Team Foundation Server. Either push your code to Git or check in your code to TFVC.
Copy the gulpfile.js and web.config files from the sample app to the root folder of your app.
Upload your code to Team Services or your on-premises Team Foundation Server: either push your code to Git or check in your code to TFVC.
Define your CI build
(If you don't see your team project listed on the home page, select Browse.)
- On-premises TFS:
- Visual Studio Team Services:
- On-premises TFS:
- Click Empty to start with an empty definition.
Add the build steps
On the Tasks or Build tab, add these steps.
Package: npm install
Install your npm package dependencies.
Pack your files into a .zip file.
Make sure you've got a copy of gulpfile.js from our sample app in the root folder of your app.
Build: Publish Build Artifacts
(Optional) Drop some of the build outputs, such as the .zip file as we do in the example below.
Enable continuous integration (CI)
On the Triggers tab, enable Continuous integration (CI). This tells the system to queue a build whenever someone on your team commits or checks in new code.
Save, queue, and test the build
Save and queue the build. Once the build is done, click the link to the completed build (for example, Build 1634), click Artifacts, and then click Explore to see the .zip file produced by the build. This is the web deploy package that your release definition will consume to deploy your app.
Continuously deploy (CD) your app
After you've run the CI build, you're ready to create a continuous deployment (CD) release definition so that you can deploy your app to:
What code is in the sample app?
Our Node.js Hello World sample app contains:
|-- .gitignore `-- helloworld |-- gulpfile.js |-- package.json |-- server.js |-- web.config `-- typings
The gulpfile.js script zips up the app so it can be deployed to Azure. The web.config file enables running the app on Azure. The .gitignore file keeps build artifacts on your dev machine from getting into your Git repo.