Posts Tagged ‘Automation’
Hosted Microsoft TFS – Team Foundation Service – Part 4: Connect your project to TFS and create a build definition
February 24th, 2012 by Tobias Zimmergren
Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren
Introduction
A while back an announcement was made that TFSPreview.com had been made available for general testing. Various bloggers at Microsoft put an invitation token in their MSDN blogs so everyone can have a go at it.
In this article series we’ll take a very quick look at what the hosted TFS solution by Microsoft looks like.
Articles currently in the series:
Steps to hook up a project to your new build server
This article obviously assumes that you’ve already followed along with the previous articles and hooked up a build configuration for your TFSpreview account. Now we’ll take a look at how we can get our projects hooking up in a CI/Automated Build scenario with Team Foundation Services.
The steps from this point onwards are basically the same as if it would be an on-premise TFS server in your own domain. Your build server is configured, your code is hosted in TFS and all you’ll need to do is connect your project to the actual TFS and then create a new build definition.
Create a new project (or connect an existing one) and connect to TFS
We’ll start from the beginning and create a new Visual Studio 2010 project (in my case it’ll be an Empty SharePoint Project), and remember to tick the Checkbox "Add to source control": ![]()
Make sure that the project is connected to your TFS server, check in the source and we can get started:
Create a new build definition
At this point (if you’ve followed the articles in this article series) you should have a TFS server, a connection from Team Explorer to your TFS server and also a new project hooked up in your repository. Now its time to create our first build definition so we can automate the builds and deployments.
Start by navigating to your Team Explorer and right-click on Builds and then click the "New Build Definition…": ![]()
This will give you the following new dialog where you can specify details for your build: ![]()
Move on to the "Trigger" tab. In my case I want to enable CI (Continous Integration) for my project: ![]()
Move on to the "Workspace" tab. In my case I’ll leave the Source Control Folder as the default root as seen below. You can choose to specify a specific TFS project if you don’t want to include all. ![]()
Move on to the "Build Defaults" tab. You’ll need to specify a build controller (you should have one here since we created one in the previous article). You will also need to specify a drop folder, where your binaries are going to be delivered upon the build: ![]()
Move on to the "Process" tab. This is where things get really interesting. You can from this dialog specify a variety of different variables for your project when it builds. I’m not going to dig into details here because my good mate Chris O’Brien have covered all of that in his article series about automated builds. ![]()
Save the build definition and validate that it appears in the Team Explorer: ![]()
Test the build configuration
In order to validate that our setup now works with TFSpreview.com and our own build server and to validate our newly created build definition, simply make some changes to your project and check it in and have it automatically schedule a new build (We chose Continuous Integration, which will build on each check in). You can see that the build is now scheduled and currently running: ![]()
And after a while you can validate that it is Completed: ![]()
The final validation is of course to see the drop folder that we specified and make sure that it now contains our newly built sources: ![]()
Voila. Build seems to be working.
Summary
This post was intended to give you an overview over the simplicity of creating a simple build definition and getting started with automated builds in TFSpreview (hosted Microsoft TFS). Pretty neat and it seems to be working just the way we want.
Obviously there’s some apparent questions like:
- What if I want to output my .wsp files as well?
- What if I want to execute a specific script upon the execution of the build so I can automate test-deployments?
- Etc. etc.
My first recommendation is to visit Chris O’Brien and read all the posts in his CI/automation series which is simply amazing.
- Posted in Technical
- 3 Comments
- Tags: Automation, CI, Cloud, SharePoint 2010, SP2010, TFS
Hosted Microsoft TFS – Team Foundation Service – Part 3: Configure a build server to work with TFSpreview
February 23rd, 2012 by Tobias Zimmergren
Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren
Introduction
A while back an announcement was made that TFSPreview.com had been made available for general testing. Various bloggers at Microsoft put an invitation token in their MSDN blogs so everyone can have a go at it.
In this article series we’ll take a very quick look at what the hosted TFS solution by Microsoft looks like.
Articles currently in the series:
Getting your first scheduled build up and running
In order to get a scheduled build that talks to your TFSPreview repository, you’ll need to follow these steps and make sure the prerequisites are fulfilled.
Prerequisites
- Install the Build Service for the Team Foundation Server 2011 Developer Preview
This download contains Visual Studio 2011 Developer Preview with TFS 2011 Developer Preview - Preferably a separate machine aimed for builds.
Note: If you don’t have SharePoint 2010 installed, the installer have an option for installing SharePoint Foundation 2010 for you. In my case however, I’ve got SharePoint Server 2010 Enterprise running already.
Installing the package
First of all, launch the ISO file that was extracted from the downloaded package and you should see this screen:
We want to install Team Foundation Server before we proceed, so choose the first option under the Install headline, which will bring you to this dialog:
You’ll need to accept the EULA and if you’re awesome you’ll keep the second checkbox checked so Microsoft can review any issues that may be encountered during the process so they can have a look at them pre-RTM. Click Continue and then click Install Now in the dialog that follows: ![]()
You may or may not need to reboot the computer while it’s performing the installation, depending on whether you’ve had some of the prerequisite artifacts installed prior to the installation or not.
Now just sit tight for a while as the installer takes care of the installation for you. Grab a newspaper, get a coffee, check some important stuff on Twitter or simply multitask with other things while you wait.
When it’s done, you’ll have a few options of what type of installation you want to do:
Please note: At this point you have several options for how to proceed with your installation. You can now choose one of the following installation options:
- Configure Team Foundation Application Server
- Configure Team Foundation Server Proxy
- Configure Team Foundation Build Service
- Configure Extensions for SharePoint Products
In my case I’ll be choosing the "Configure Team Foundation Build Service" since I only need the actual Build Agents and Build Service – the TFSpreview.com is hosting the actual TFS server.
Next step will present you with a dialog like the following, where you’ll have to choose what default team project collection to utilize for the build server. Since we don’t have TFS installed the box is currently empty, but fear not for your TFS server is hosted in the cloud (tfspreview.com, remember?) so we’ll just have to go and add that connection as well.
Click the "Browse…" button to open the dialog for choosing your TFS connection ![]()
If you haven’t already connected to a TFS server, this dropdown will be empty. Click "Servers…": ![]()
Finally enter the URL to your TFS collection and click "OK": ![]()
You will see a dialog that enables you to log in to the services (use the Login details you signed up with for tfspreview.com): ![]()
When the sign-in is completed you’ll see that you now have a list of TFS collections. Choose your DefaultCollection (or otherwise) and click "Connect": ![]()
It should hopefully say something like this, telling you there’s no build servers unless you’ve already configured it previously: ![]()
In the next dialog I’ll choose "Use the default setting" for my setup: ![]()
In the next dialog you’ll have to choose credentials for your build rig. I’m using a dedicated domain account called SHAREPOINTSPBuild: ![]()
Make sure you validate the configuration and then press "Next" ![]()
If awesomeness is found on your machine, it should look something like this: ![]()
Click the "Configure" button and let the installer have its way for a while. Hopefully all these fancy green icons will show you that things went smoothly: ![]()
With that done, in the next dialog you’ll see a nice "Success" message and you’re ready to start creating and work with your build agents: ![]()
Validate the Build Server
On your Start Menu, you should find the following new shortcut: ![]()
Clicking the "Team Foundation Server Administration Console" should bring you forth the following dialog where you can validate that your machine is properly up and running with a build server and agents. Click the "Build Configuration" option in the menu to the left and make sure your build agents are running under the controller: ![]()
Summary
If you’ve followed along with the steps in this post you’ll see how easy it is to get up and running with creating a build server (controllers+agents) for your TFS. In this case, I chose to do a connection to the TFSpreview-hosted TFS account.
In my next post in this series I’ll talk about how you can create a new build from Visual Studio 2010 from your dev-machine and have it automatically build on this build server. Gotta love automation!
Enjoy.
- Posted in Technical
- 5 Comments
- Tags: Automation, CI, Cloud, SharePoint, TFS

