<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Hemant's blog(s)</title><subtitle type="html" /><id>http://blogs.msdn.com/hemantk/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hemantk/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/hemantk/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2005-09-26T11:25:00Z</updated><entry><title>Managing builds through Command Line </title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/hemantk/archive/2005/09/26/473930.aspx" /><id>http://blogs.msdn.com/hemantk/archive/2005/09/26/473930.aspx</id><published>2005-09-26T08:25:00Z</published><updated>2005-09-26T08:25:00Z</updated><content type="html">&lt;P&gt;Before Beta3, builds could be fired only through the UI. Now a command line alternative is available. The command line tool also provides options to stop and delete a build. The latter functionality is not available through the UI. The tool provides a command line help which explains the parameters required by the commands. This blog attempts to cover this new functionality.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=4&gt;Start &lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;Starting a build requires START_BUILD permissions&lt;/FONT&gt;&lt;/EM&gt;. Scenarios where you might want to use the command line to start a build are:- &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You want to integrate kicking off a build into your workflow; where build might be just one of the steps. 
&lt;LI&gt;You want builds to be kicked off at regular intervals of time. You could use the Windows scheduler and the command line interface to accomplish this. 
&lt;LI&gt;You might want to extend the functionality of the TFSBuild system provided. An example is writing a system for continuous integration. 
&lt;LI&gt;You just love working on the console:). A simple telnet to the office from home would enable you to do the needful. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE&amp;gt;TFSBuild.exe start &lt;/FONT&gt;&lt;A href="http://btnhydbb03:8080/"&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;http://btnhydbb03:8080&lt;/FONT&gt;&lt;/A&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt; MyTestTeamProject MyTestTeamBuildType&lt;BR&gt;Microsoft (R) TfsBuild Version 8.0.0.0&lt;BR&gt;for Microsoft (R) Visual Studio 2005 Team System &lt;BR&gt;Copyright (C) Microsoft Corporation 2004. All rights reserved.&lt;BR&gt;Build number: MyTestTeamBuildType_20050926.2&lt;BR&gt;Initializing build &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Getting sources &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling sources &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling ConsoleApplication1.sln for Any CPU/Release &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling ConsoleApplication1.csproj &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling TestProject1.sln for Any CPU/Release &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling TestProject1.csproj &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling WindowsApplication1.sln for Any CPU/Release &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Compiling WindowsApplication1.csproj &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Getting changesets and updating work items &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Running tests &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Running tests for Any CPU/Release &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Copying binaries to drop location &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Copying log files to drop location &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Successfully Completed&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;FONT face=Georgia size=2&gt;&lt;STRONG&gt; &lt;FONT face=Tahoma&gt;Dump 1 Command line start console output&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P&gt;Compare this with the build report shown through the UI:-&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In the console output for the build; only the build steps are shown and the "Completed On" time for these steps is not shown. The idea is that when you are using the command line build; your main intent is to fire the build and nothing else. 
&lt;LI&gt;If you want to change the quality of the build or view the time taken for each build step you would have to go to the UI. For viewing other stuff such as change sets and work items; you could look up the Buildlog.txt in the drop share.&amp;nbsp; &lt;BR&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT size=4&gt;&lt;STRONG&gt;&lt;U&gt;Stop &lt;/U&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #f5f5dc"&gt;&lt;EM&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;A user starting the build or having ADMIN_BUILD permission can only stop the build&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#ffffff&gt;.&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;To stop a currently running build use this functionality. 
&lt;LI&gt;"Stopping" the build would kill the build process on the build machine and mark the status of the build as "Stopped". 
&lt;LI&gt;The event log on the AT has an entry per build stopped containing data about the user who stopped the build and the time when the build was stopped. 
&lt;LI&gt;There is no way to resume or unstop a stopped build. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;BR&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" color=#000000 size=2&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE&amp;gt;tfsBuild stop &lt;/FONT&gt;&lt;A href="http://btnhydbb03:8080/"&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" color=#000000 size=2&gt;http://btnhydbb03:8080&lt;/FONT&gt;&lt;/A&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" color=#000000 size=2&gt; MyTestTeamProject MyTestTeamBuildType_20050926.3 /noprompt &lt;BR&gt;Microsoft (R) TfsBuild Version 8.0.0.0 &lt;BR&gt;for Microsoft (R) Visual Studio 2005 Team System &lt;BR&gt;Copyright (C) Microsoft Corporation 2004. All rights reserved.&amp;nbsp; &lt;BR&gt;Stopping MyTestTeamBuildType_20050926.3... Done &lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Dump 2 Command line stop console output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;STRONG&gt;&lt;U&gt;&lt;FONT size=4&gt;Delete&lt;/FONT&gt;&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;EM&gt;ADMIN_BUILD permissions are required to delete a build. Deleting a build having tests enabled also requires PUBLISH_BUILD permisssions.&lt;BR&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Used for removing unneeded builds from the system 
&lt;LI&gt;Can delete multiple builds from the same Team Project on a single invocation. 
&lt;LI&gt;A delete on an ongoing build is not supported. 
&lt;LI&gt;Deleting a build entails deleting the entries for that build from the database and removing the binaries for that build from the drop location. 
&lt;LI&gt;Deleting the most recent build from a team project would cause the next build to have the same build number as the deleted build. 
&lt;LI&gt;Again an entry per deleted build is logged in the event log at the AT.&amp;nbsp;&lt;BR&gt;&amp;nbsp;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;D:\Program Files\Microsoft Visual Studio 8\Common7\IDE&amp;gt;tfsBuild delete &lt;/FONT&gt;&lt;A href="http://btnhydbb03:8080/"&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;http://btnhydbb03:8080&lt;/FONT&gt;&lt;/A&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt; MyTestTeamProject MyTestTeamBuildType_20050926.1 MyTestTeamBuildType_20050926.3 /noprompt &lt;BR&gt;Microsoft (R) TfsBuild Version 8.0.0.0 &lt;BR&gt;for Microsoft (R) Visual Studio 2005 Team System &lt;BR&gt;Copyright (C) Microsoft Corporation 2004. All rights reserved.&amp;nbsp; &lt;BR&gt;Deleting MyTestTeamBuildType_20050926.1... Done &lt;BR&gt;Deleting MyTestTeamBuildType_20050926.3... Failed &lt;BR&gt;The path is not of a legal form. &lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT face=Tahoma size=2&gt;&lt;STRONG&gt;Dump 3 Command line delete console output&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff"&gt;&lt;FONT style="BACKGROUND-COLOR: #ffffff" color=#000000&gt;The failure to delete the last build is a &lt;STRONG&gt;known issue&lt;/STRONG&gt; in Beta3 bits&lt;/FONT&gt;. This happens when a build that was stopped in the "Initializing Build" step is attempted to be deleted. The build has been deleted from the database; but not from the drop location. The workaround is to manually delete the folder from the drop share.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;U&gt;About Me&lt;/U&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I have been at Microsoft for just over an year in the discipline of Test. Reading fiction is one of my hobbies that is still alive:-). I am onto "The Fountainhead" these days. Puzzleses excite me; and nothing is more attractive than what eludes me. Writing blogs is out of that elusive list now:-)&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=473930" width="1" height="1"&gt;</content><author><name>hemantk</name><uri>http://blogs.msdn.com/members/hemantk.aspx</uri></author></entry></feed>