Thursday, July 31, 2014

Configure TFS (web version) for builds.

Yay! You've gotten your TFS (web version) installed and your code checked in.  Time to automate your builds so when you check in your code the phrase "works on your machine" will apply to "works on that web machine" as well :).

To configure TFS for builds:

Step 1: open up VS2013 Express for Web and open your project in question that's been checked in:

Step 2: go to the Team Explorer tab and click on Builds.
Step 3: Click on Builds, you should see the following screen:
Step 4: Click on New Build Definition:

Step 5: options! options! options!  Want to change your build name to something pertinent?  Go fer it!  For my purposes every time I check in some code I want it to build to verify what I wrote is compatible with what's checked in.
     a)  For this i'm clicking on the Trigger menu item and selecting Continuous Integration as the option for me.
     b)  Click on Source Settings:   If you wish to exclude certain paths in your code for building you can do that here. The active paths listed will work for my purposes.
     c)  Click on Build Defaults:  needing to build out your files to a particular location?  Here's where you can do that for your project.  I don't require that for my project so I'm going with the top option.
Step 6:  I'm going to rename my build process so I click on General and rename my build definition name.  I'll use "Build On Check In" for a meaningful name for keeping up with my project management.  Now save the Build Definition.
Now you should see on the right within Team Explorer under All Build Definitions the name of your project, for my purposes "Build On Check In".  Right click on it and choose "Queue New Build".  You should see a screenshot like the following:
Step 7:  You should see a screen like the following screenshot.  For my project purposes all options listed will work well for my project.  If you need additional parameters for a more specialized build they can be entered on the Parameters tab.
Step 8:  click Queue when you're ready to send up your new build definition to the server.  Huzzah! You should now have a build definition.
     a)  Log into your *visualstudio.com website to verify for yourself, here's the one I'd just created:
     b)  Click on Build, you should see your new build option on the lower left hand side.

Time to verify the build works, aka I get to break code on purpose!  Compiled my code and received the error expected, lets see what happens when I check in knowingly bad source code:
When I go to the web tab with my visualstudio account info, error!
Huzzah!  Fix your code and check it back in.  You should see a successful build like:
Yay, configuration o' builds complete.





No comments:

Post a Comment