Skip to main content

Continuous integration with visualstudio.com and TFS


As a developer, we all are using some kind of source control provider to maintain versions of our source code.  But another aspects of source control to is to make sure that code committed in source code repositories are  perfect and it will not break the build of particular software. That’s why Continuous integration is very much popular this days.

What is Continuous Integration:


As per wikipedia
Continuous integration (CI) is the practice, in software engineering, of merging all developer working copies with a shared mainline several times a day. It was first named and proposed by Grady Booch in his method, who did not advocate integrating several times a day.
In simple words, when developers checks in or commit code to source code repository a build of software will automatically triggers to check whether current check-in/commit of code breaks code or not.

In this post we will learn how we are going to use visualstudio.com and TFS for continuous integration of our sample application.

What is VisualStudio.com:


VisualStudio.com is an application life cycle management platform, one of the quickest way for new users and small team to start developing apps in cloud. It’s provides complete application life cycle management experience including source code repositories, code reviews, build integration, deployment etc.

Followings are some of features of visualstudio.com.
  • It provides complete ALM applications online you don’t have to need to setup an infrastructure for that.
  • It supports Git(Distributed) and TFVS(centralized) source control.
  • It supports continuous integration so it creates build server when they are required and bring down when its not required.
  • It supports latest project management workflows like Agile.
  • It supports team collaborations, which facilities real-time collaboration between teams.
  • It’s free for 5 users.
You can find more information about visualstudio.com from following link.
http://www.visualstudio.com/products/what-is-visual-studio-online-vs

Setting up code repository with visualstudio.com:


First things you need to do  it to login in visualstudio.com. You can use your existing Hotmail, live or outlook  email account for that. Once you login it will show you dashboard from where you can create a new project on visualstudio.com

Visualstudio.com new project

Click on new to create new project. It will load dialog for create new project.

Create new project template in visualstudio.com

It will ask for your project name, description related to project and it will ask to choose your template and version controlling system. Here I have selected Team foundation version control but it will also support Git also. Clicking on “Create project” will create new project. Once project is created you can navigate to that project from dashboard.

project-navigation-visual-studio

Clicking on that project will present you a dashboard of selected project.

dashboard-test-application

On right side of dashboard there is a link called “Open in visual studio”.

Open in visual studio with visualstudio.com

Once you click on it. It will launch visual studio from your desktop. In visual studio go to team explorer it will ask you configure your work space.

Configure work space in Team explorer visual studio

Click on configure work space. It will ask to set map your work space with location.

map-work-space

Then click on Map and get. Once mapping is done you can add the solution to project. From Team explorer go to solution part and click on new solution part.

create-new-solution-visual-studio

Here I’m going to use ASP.NET MVC sample application so I will add an ASP.NET MVC project to solution and team explorer project.

visual-studio-new-application

Created ASP.NET application and selected MVC as below.

Mvcaplication

Now it’s time to build definition so go to team explorer and click on build.

team-explorer-build-option

It will load build section.

build-tab-team-explorer

Click on new Build Definition it will load build definition dialog. In General tab of build definition you need to make sure it is enabled.

build-general-dialog-visualstudio

Now go to Trigger part where you need to check continuous radio button. Which will trigger build on each commit.

build-contininous-integration-visualstudio

Now you close the build dialog it will save the current build definition. And you see it in all build definition in team explorer.

team-explorer-build-defintion-list

Now to test the continuous integration, go to pending changes in team explorer and check in the code.
 
checkin-team-explorer

Now as soon as you check in it will queue a build in build section.

build-queue-team-explorer

You can see that in visualstudio.com also.

build-queue-visualstudio

As soon as it completes building solution, It will update the status at both places.

build-sucessfull-contininous-integration

Same for visualstudio.com.

build-sucessfull-contininous-integration-visualstudio

That’s it. It is very easy to setup continuous integration with visualstudio.com. So what you are waiting for go and start using it.  Stay tuned for more.

Comments

Post a Comment

Your feedback is very important to me. Please provide your feedback via putting comments.

Popular posts from this blog

How to create Rest API(Web API) with ASP.NET Core 1.0

Recently Microsoft has released ASP.NET Core 1.0 RC2, I am getting lots of request from readers that about creating Web API. So I thought it will be a good idea to write a blog post about how to create Rest API(Web API) with ASP.NET Core 1.0.

So let’s get started via creating an ASP.NET Core 1.0 Web Application like following.



Once you click on ASP.NET Web Application, It will ask whether you need to create Web Application or Web API application. We are going to Web API so I am going to select Web API Application like following. Please note that in ASP.NET Core 1.0 there is no separate libraries or DLLs required for creating web APIs. This is just a project template.



Now once you click on OK It will create a Web API application with default values controller and program.cs.  As you know Program.cs is now starting point for the ASP.NET Core 1.0 application so It contains all the required configuration and startup items. Following is a code for that.
using System.IO; using Microsoft.Asp…

How to use migration with Entity Framework Core

Entity framework core is  the lightweight, extensible and cross-platform version of Entity Framework. Before some time, Microsoft has Released a new version of Entity Framework RC2. I have written a couple of blog post about Entity framework code first migration earlier for Entity framework 6.0. So there was a couple of request coming for writing a blog post about Entity Framework Core RC2 migration. So I thought it will be a good idea to give an overview how database migration works in Entity Framework Core RC2. This post will cover a basic scenario where we are going to create the database with existing ASP.NET Identity migration and then we are going to create a new model and have that migration applied in the database.

How to use Entity Framework Migrations: Let’s get started, To demonstrate entity framework core migrations, I am going to create a sample asp.net core web application like following.



Once we select asp.net core application it will appear the following dialog.



Now w…

Solution: gulp is not recognized as internal or external command- Visual Studio

Recently, After Upgrading to the newer version of Gulp, I was getting this error.  After doing lots of  finding online and in my system I was able to figure out that Modules like Gulp does not installed to the path. So when you try to run it from the command line it was showing below error.
gulp is not recognized as internal or external command How to solve : gulp is not recognized as internal or external command To solve this error we just need to create a new environment variable and set the NPM modules path there.

To create an environment variable,  Right click My Computer/ This Pc and click on properties.  It will open following windows.



Go to Advance System Settings and it will open system properties windows like below.



Click on Environment Variables it will open an environment and system variables windows like below.



Click on new System variable and put NODE_PATH in system variable name and %AppData%\npm\node_modules into the variable value like below.



Click on Ok. That’s it. N…