Sunday, December 14, 2014

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.
Share:

4 comments:

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

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews