Showing posts with label TFS. Show all posts
Showing posts with label TFS. Show all posts

Saturday, February 14, 2015

Connect Visual Studio with Visual Studio Online

From this post, I'll share step by step procedure that you need to follow to get connected with your online TFS account i.e. Visual Studio account

If you need to know more about Visual Studio Online, below URL will be informative for you.
http://www.visualstudio.com/en-us/products/what-is-visual-studio-online-vs.aspx

If you have not yet owned or created a Visual Studio online account, check my previous blog post to get an idea.

First let's take a look at the reverse way.

1. Open up Vs 2013 and Navigate to Team --> Connect to Team Foundation Server....




2. Click on Select Team Projects. "Connect to Team Foundation Server" dialog will appear. Then click on Servers and then on Add to add your online visual studio account url.


3. Add your visual studio online url as below and click OK.


4. You will be prompted to enter your Microsoft account credentials. Once authenticated, you will get a list of team projects which you have access.


5. Click on connect to get connected with your team project. Once this is setup |Team Explorer" side panel will pop-out as below.



Now the easiest one step way. Once you log into the Visual Studio Online account and navigate to the team project, you can easily open-up your team project with visual studio  2013 .


Sunday, January 25, 2015

Install & Configure Sonar with TFS 2012


This article demonstrates how to configure Sonar with TFS 2012 in Microsoft Windows Server 2008R2 environment with Microsoft SQL Server 2008R2 as the sonar database.

I've skipped the TFS installation and configuration part. You must have a configured TFS 2012 installation, before configuring sonar.


SonarQube Platform Overview
The SonarQube platform is made of 3 components:

1. A database to store:
The configuration of the SonarQube instance (security, plugins settings, etc.)
The quality snapshots of projects, views, etc.
2. A Web Server for users to browse quality snapshots and configure the SonarQube instance
3. One or more Analysers to analyze projects


Configure the Database

1. Open up the SQL Management Studio and create a new login as below.
login name : sonar
password : sonar


2. Create a new database : Database name : "sonar"
3. Create the database user and tick all the permissions


** points noted from sonar documentation:
Note that collation must be case-sensitive (CS) and accent-sensitive (AS).
Install and Configure the Web Server

1. Download and install the latest SonarQube version from here.
2. Create a folder on a disk partition that has a reasonable amount of free space and rename it as "Sonar". Inside of that, create another and rename it to "SonarQube".
3. Extract the downloaded SonarQube binaries inside the "SonarQube" folder.
4. Edit the below file and apply the below configurations.

X:\Sonar\SonarQube\conf\sonar.properties



- Apply the username and the password that was given when you create the sql user.
- Alter the Ms-SQL configuration string as below

#----- Microsoft SQLServer
# The Jtds open source driver is available in extensions/jdbc-driver/mssql. More details on http://jtds.sourceforge.net
# The validation query is optional.
sonar.jdbc.url: jdbc:jtds:sqlserver://<database server>;databaseName=SONAR;instanceName=<database instance>;selectMethod=cursor;
sonar.jdbc.driverClassName: com.microsoft.sqlserver.jdbc.SQLServerDriver
sonar.jdbc.validationQuery: select 1
sonar.jdbc.dialect= mssql

5. Now move to the below folder and create a new folder called "mssql" if it does not already exist.
6. Download Microsoft SQL JDBC Driver and extract the sqljdbc4.jar file to mssql folder.
7. Execute the StartSonar.bat from either x:\Sonar\SonarQube\bin\Windows-x64-64 or Windows-x64-32 depending on your configuration.
8. Then open up a command prompt as run as Administrator and execute InstallNTService.bat located in the folder used in step 7.



9. Restart your PC, and then navigate to http://localhost:9000 (from inside the installed server)
Default Admin user name/password : Admin/Admin


10. Now download and extract the SonaQubeRunner from here and extract to the below folder:
x:\Sonar\SonarQube\sonar-runner-2.4\

11. Replace Ms-SQL section (with what you have used in the previous step)of the configuration file located in the conf folder.


12. Now create a system variable called "SONAR_RUNNER_HOME" and point it to the Sonar Runner folder.

13. Add Sonar-runner bin folder to the "Path" Environment Variable


14. Open-up a new console and type "sonar-runner", if perform some checks.. then you are still on the road.
15. Create a file "sonar-project.properties" add it to the root folder of your Visual Studio solution, and add it to TFS.


16. Add these lines to that file.


17. Another 2 installations are needed to be done.
C# Plugin | Analysis Bootstrapper for Visual Studio Projects Plugin

Copy both downloaded plugins to x:\Sonar\Sonar-runner-2.4\extensions\plugin\ and then restart the SonarQube server.

18. To analyze your C# project. Open up a common prompt and navigate to the folder where your sonar-runner property file is located in. Type sonar-runner and once the analysis is finished, open up the Sonar portal, and you will see a new project is listed.





19. Now the last step, include a post build script in your main project.

20. Final step, create a CI build definition and trigger it, and when the build success, check the  http://<your sonar installed server>:9000, and you will see the project. You can create custom dashboards with inbuilt widgets to get more insight into your code base.

A useful Visual Studio extension called VSSonarExtension can be used to analyse code against the sonar default rules. You can read more about the extension here.

Most of the stuff that I've summarized here were extracted from the below sites :
http://docs.sonarqube.org/display/SONAR/Installing
http://www.sezok.de/sonar/sonar.html


Friday, July 11, 2014

Free Source Version Control Facility from Microsoft for Small Teams

They have introduced Visual Studio Online with the capabilities of Team Foundation Server and additional cloud services, Where we can create our source code repository on the cloud and work in the same way as what we do now.

This online user plan includes everything from the hosted GIT repos, project tracking tools, and continuous integration tools. These user plans are described in
Visual Studio Online User Plans

The Visual Studio online basic is given free for up to five users. In this blog, I’ll elaborate on each and every step of how you can get your projects migrated to online TFS and work as a small team.

 ** You need Visual Studio 2013 Professional or Ultimate installation to use this feature.

Steps :
1. You must create a Live account, and verify the given email and phone number. Go to http://www.visualstudio.com/en-us/products/what-is-visual-studio-online-vs.aspx​ and logged in using your credentials.

 If all the validations and verification are completed, you must see your own name as below.

3. Then click on Create a free account now to create a Visual Studio online account.


4. Now you should be landed on this page.


5. Now type your project name, chose the version control system TFVC / Git, Process Control Template, and click on Create project. Read more on the SVC system supported by Microsoft Visual Studio : Use version control

6. Now you must see this page.


7. Now click on "Open with Visual Studio to connect". You might be asked for your credentials, please provide them. Then you will be connected to the online TFS account that you have just created.


8. Now you can add your solution to the online TFS.