Hi, Currently we are using TFS 2010. I have automated the build using team build definition which will build the solution also it will execute all the unit test cases for the respective project. If any one of the unit test case fails it would fail the build and it will show the unit test case results (i.e. How many test cases passed/failed) I want to execute a batch file which will take all the unit test cases result and send mail to me. Can anyone please tell/guide me after which activity (in team build definition) I should run/ call my batch script to achieve this? Thanks in advance.
Hi stars123, Here are the step by step process. Hope it will sovle your problem 1. I would recommend to keep the batch file on build server, if you wish to keep out off build server then keep in shared folder where build server have access to it 2. Open BUild workFlow - Drag and Drop the 'InvokeProcessActivity' - Right Click on Invoke Process Activity and Select properties - give the path to Batch FIle ( Step 3,4 and 5 are optional, while executing batch script these activities will log the messages in build log file) 3.
Execute Batch File Remotely
Expand the InvokeProcess Activity - Drag and drop the 'Writebuild Message' and 'WriteBuildError' activites as shown below 4. Right click on'WriteBuildMessage'activity and Set Properties Importance - Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High Message - stdOutPut 5. RIght Click on'WriteBuildError' Activity and Set Properties Message - errOutPut Save it and Queue the new build, Should be good to go. THanks Haribabu Bavanari. Hi stars123, Here are the step by step process. Hope it will sovle your problem 1. I would recommend to keep the batch file on build server, if you wish to keep out off build server then keep in shared folder where build server have access to it 2.
Open BUild workFlow - Drag and Drop the 'InvokeProcessActivity' - Right Click on Invoke Process Activity and Select properties - give the path to Batch FIle ( Step 3,4 and 5 are optional, while executing batch script these activities will log the messages in build log file) 3. Expand the InvokeProcess Activity - Drag and drop the 'Writebuild Message' and 'WriteBuildError' activites as shown below 4. Right click on'WriteBuildMessage'activity and Set Properties Importance - Microsoft.TeamFoundation.Build.Client.BuildMessageImportance.High Message - stdOutPut 5. RIght Click on'WriteBuildError' Activity and Set Properties Message - errOutPut Save it and Queue the new build, Should be good to go. THanks Haribabu Bavanari.
My task is: after TFS build 1) On a server X stop file Example.exe 2) Copy files from Drop Location into server X 3) Run a brand-new version of Example.exe on a server X I'm updating DefaultTemplate.xaml in TFS 2012, Visual Studio 2012. I'm entering InvokeProcess activity that runs Do.bat script. My Build Agent copies files to server X and then runs file X. Do.bat Do.bat is something like taskkill /F /IM Example.exe start%p0Example.exe So, the problem is the Example.exe is running on a Build Agent, not on server X. How can I make build agent run an executable file on another server? The additional question - is it worth using bat files as scripts in TFS Build?
If you do not already have SAN Health Diagnostics Capture,. Step 2 Ensure you have these minimum system requirements: • Intel Pentium processor 133 MHz or higher • Microsoft Windows 2000 or higher • 64 MB RAM / 10 MB available hard disk space Step 3 Download SAN Health Professional This free framework enables you to audit the reports in detail, utilizing advanced search functionality and inventory tracking. In addition to its standard data analysis and search capabilities, the SAN Health Professional framework supports options add-on modules. Hp tools download free. You can import up to two SAN Health captures to SAN Health Professional for immediate, detailed analysis about any SAN component. Step 1 SAN Health Professional leverages report generated by SAN Health Diagnostics Capture.
![Execute Batch File After Tfs Build Process Execute Batch File After Tfs Build Process](/uploads/1/2/3/7/123732657/605439092.png)
If you're not keen on editing the build template, another option might be to use the stock XAML build template, create a dummy.proj file that gets 'built,' and use the pre- or post-build scripts. You can invoke the batch file from a simple PowerShell script. Here's what the dummy.proj would look like: $(MSBuildExtensionsPath) ExtensionPack 4.0 MSBuild.ExtensionPack.tasks $(MSBuildExtensionsPath) ExtensionPack 4.0 MSBuild.ExtensionPack.tasks. Autoritatea Tutelara.
I run into a situation which needed to run a batch file from, this batch file downloads some files from a file server and I just needed to copy that files later during the same build process to another machine. I will simulate that by creating a batch file that create a file and copy the created file to another machine. Here is the batch file that create a new text file. If I just double click on that file, it will create a new file called NewFile.txt. Open any Build Process Template and delete all its activities.
![Parameters Parameters](/uploads/1/2/3/7/123732657/522937082.png)
Add Sequence Activity with name: Overall Build Process. Drag and drop Activity inside the Sequence Activity. Drag and drop AgentScope Activity with name: Run on Agent. Drag and drop GetBuildDirectory Activity inside AgentScope Activity.
![Execute Batch File After Tfs Build Process Execute Batch File After Tfs Build Process](/uploads/1/2/3/7/123732657/617537718.jpg)
Drag and drop InvokeProcess Activity with name: Call a batch file. Declare variable of type with name: MyBuildDetail,and assign the return value from to it. Declare variable of type String with name: MyBuildDirectory,and assign the return value from GetBuildDirectory to it. We need to include the folder that contains the script or the batch file in the Source Settings of our Build Definition; so the build server copy it in the working directory of the build. But first, let’s remember what is the working directory of the build, it’s a folder like a temp folder the build process uses to get the last change set so it could build it, we configure that from TFS Administration Console for the agent. So we will need to include the folder that contains the script or the batch file in the Source Settings of our Build Definition. So now if we run this build, we will find that it gets the last change set including the script.
So now I can give the InvokeProcess Activity the path on the working directory as the following. Remember if I run the build, the file will not be created in related path, but it will be in System 32 folder Then I will need to copy that file to the needed machine, see the following post for typical steps.