X
20Aug

Automating .NET builds using CCNET and TFS

CruiseControl.NET (CCNET) is an open source tool used for continuous builds on server, where testing is required parallel to development. CCNET periodically checks the version control for changes to codebase, builds the source code if any modifications found, publish the build to website hosted location and notifies the build status software stakeholders.

Here I am going to discuss on how to configure the CCNET for continuous builds using TFS as source control.

What you need?

  • CCNET Server
  • Source Control
  • CCTray

CCNET Server

CruiseControl.NET is the build server for preparing, publishing builds on server. CCNET pings to the source control for every 30 minutes (this is default value and can be changed in config file) for codebase modifications. You can download and install the CruiseControl.NET from here.

The CCNET comes with web dashboard and server applications.

  • Web Dashboard is a web version of CCNET where we can see the build logs, force for the build, stop project, etc.
  • Server is a console application for preparing and publishing builds. This server is the heart of build process.

We need to configure the project’s build process in ccnet.config. This file was located in CCNET installation directory. If you install the CCNET in default location, here is the location of config file:

C:\Program Files (x86)\CruiseControl.NET\server\ccnet.config

The configuration file is in XML format with below structure:

  • Project (name of the project)
    • Source Control (source control details)
    • Triggers (interval time for new build [either force build or build on modifications exist] )
    • Tasks
      • MS Build (building project solution)
    • Publishers
      • Executable (actions to be done before publishing the code)
      • MS Build (publishing project)
      • XML Logger (logging integration error, if any)
      • Emails (sending emails to developers/others on build status)

Open the configuration file in a notepad or using in your favorite editor and add one more project node as shown below:

configuration

The build configuration in CCNET is a little trickier and here are the detailed descriptions for the above figure:

  1. Name of your project
  2. Web version of CCNET, and will discuss later in this blog
  3. Your source control type
  4. Your TFS local/remote URL
  5. Username to access TFS project
  6. Password
  7. Your organization domain where user TFS a/c to be validated
  8. Project node path from TFS source control
  9. Working directory of your project
  10. Triggers the build for given ‘n’ number of seconds
  11. MSBuild.exe path, which comes with .NET Framework and used for building your solution from working directory
  12. Name of solution file
  13. Build arguments
  14. This is an action to be fired before/after the build. (ex: before publishing the project to target directory, first delete the files from target directory using batch file)
  15. Name of the project file to be published
  16. Build arguments along with the output directory, where project to be published
  17. Log file directory path

That’s all about configuration. Let’s start the ccnet.exe which is available at the same place of ccnet.config and watch out how your project is building, publishing.

Source Control

Using CCNET you can integrate many source control systems like, TFS, SVN, VSS, Git, ClearCase, etc.

CCTray

CCTray is a client application used to know all about build statues and can force for builds. You can download the CCTray from here. Also you can download the CCTray from CCNET’s web dashboard.

cctray

You can add the project to CCTray using below steps:

  1. Open CCTray
  2. Goto File -> Settings, it popup a dialog
  3. Click on Add button, again it popups another dialog
  4. Click on Add Server button, once again it popups another dialog
  5. Now, Add the IP Address where CCNET server was installed and click Ok
  6. In the back dialog, it shows name of the projects configured on CCNET, select one or more projects and click on Ok and again Ok
  7. You can see the selected project’s statuses.

CCTray will also give you windows notifications whenever the build success or failed on server.

What Next?

In my next blog, I will discuss about CCNET’s web version, where you can see more details about each build and build log information. And also we’ll discuss on how to send email notifications to developers or project stakeholder about each build.

Have any questions? Let’s discuss in the comments section below….

Related

Deploy .NET application on IIS using GitHub actions

In this blog I will be showing how to deploy a .net application on IIS server (self-hosted runner). ...

Read More >

What are Frames? How to handle frames in Selenium WebDriver with C#?

IFrame (FullForm: Inline Frame) is an HTML document that is included in another HTML document and is...

Read More >

What is Synchronization? Handling Synchronization in Selenium WebDriver using C#:

Synchronization meaning: when two or more components involved to perform any action, we expect these...

Read More >

How to Prevent Users from Moving Task to Closed State with a non-Zero value Remaining Work field in VSTS/TFS

In this Blog I am going to explain how we can customize Task in VSTS/TFS to Prevent Users from Movin...

Read More >

Sending Test reports by Email using Office 365, Gmail

Wouldn’t it be great if Test Report are sent automatically across team as soon the Test Execut...

Read More >

Token Based Authentication for Web API's

Securing ASP.NET Web API using Custom Token Based AuthenticationProviding a security to the Web API&...

Read More >

Dashboard Migrator Tool

This is a web service which helps you to copy the VSTS dashboards from 1 team to another team easing...

Read More >

Canarys Automations Pvt Ltd recognized as finalist for 2017 Microsoft DevOps Partner of the Year Award

  Bengaluru, Karnataka, India — June 2, 2017 — Canarys Automations Pvt Ltd tod...

Read More >

Custom Control in WPF

File Upload Custom Control in WPFThis article is about Custom control in WPF, Custom controls are al...

Read More >

ASP.NET: Audit Trail Implementation using Entity Framework

When you are working with certain projects which involves the Customer records, you might need to tr...

Read More >

Share

Comments

Thanks for sharing, it was informative. We play a small role in upskilling people by providing the latest tech courses. Join us to upgradeMS BUILD ONLINE TRAINING
10/9/2020 1:20:54 PM | Reply

Post a Comment

Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
Tags
Monthly Archive
Subscribe
Name

Text/HTML
Text/HTML
Contact Us
  • *
  • *