In TFS build I call to a nant script using a custom activity InvokeProcess (we use NANT till we will be able to move to "TFS language")
I want to fail the build if NANT fails. I guess I should use the Result property of the InvokeProcess.
How I do that?
Thanks
I think you can find what you need here.
Related
I'm converting our XAML build process to vNEXT build for our on-premise TFS 2017. One step I like to automate is the create a work item task for a specific user to execute after the release has been done. Is there a built in way to do this? I have a PowerShell script but I'd prefer not to use it if there is already a better way
No, there is still no out-of-the-box feature for this. Either using the REST api or the Client Object model in a powershell script just like you have done will do the trick.
You could also take a look at this similar question: How to have TFS automatically add certain tasks to new work items?, jessehouwing has provided a great answer.
Another way is using TFS Aggregator- a serverside pugin for TFS 2013
(update 2 and later) which has the ability to create new work items
based on rules. An example task can be found here:
https://github.com/tfsaggregator/tfsaggregator/wiki/Auto-Create-Children
Update
After go through the extension in VSTS marketplace (https://marketplace.visualstudio.com/) , there is also no existing task could do this. You may still use your powershell script or write your own extension.
we have around 300 TFS CI build definitions and now i want to change it into schedule build. Is it possible to change CI multiple Builds into scheduled.
Its really heck process to change one by one. I want some PowerShell or batch script to run the builds or any tool to change multiple TFS build definitions to schedule builds.
Thanks in advance.
You can use the TFS API to programmatically create and edit build definitions. Here is an example:
http://blog.ehn.nu/2010/04/creating-a-build-definition-using-the-tfs-2010-api/
Have a look at:
https://visualstudiogallery.msdn.microsoft.com/73bf2d8e-aec6-406c-8e7f-1c678e46557f
You should be able to change the trigger for multiple builds at once. I also created a set of powershell extensions to create/edit builds in bulk, but there is no CmdLet for the trigger yet, but have a look if you are interested in extending it (send me a pull request if you do ;)):
https://github.com/sanderaernouts/tfs-build-tools
I am creating a build definition in visual studio 2013. As you know, while creating build definition we can also set the assembly (in "Automated Tests" section) which contains the unit test methods to run. I am able to create the definition till this point. Now, what I want is once the test run is over, I want to call an exe that will parse the Trx file generated as a result of test run and send the run results in an email.
Can anyone have an idea about where I can set the path to the exe and pass some arguments to it while creating build definition? If this cannot be done while creating definition, what else is the other way to achieve it?
Thanks!
What you ask involves multiple steps, especially if you want to pull the tool from version control (which is IMHO the best option).
See the ALM Rangers' Team Foundation Build Customization Guide for help and guidance on this topic.
Or you can just setup an email notification when the TFS Build completes. That should include the test run results, and a clickable link to go to the full build report.
I am new to Microsoft TFS, (I am used to Perforce - a similar tool).
How can we trigger or run a user script automatically when ever a particular event occurs
in TFS?
For instance, I want to run my java file when ever a change to any file has been saved through TFS.
(In perforce I used "Change-commit triggers" to achieve this)
Please help me out.
EDIT: After some research,
I figured that we need to "Use the InvokeProcess activity to start a process (run a program) on the build server" from the following source.
But How do I use it?? I am using a "Microsoft Team Explorer for Visual Studio 2012". Not able to figure out how to use InvokeProcess.. Please help me out..
you can't use the default template for invoke process. you need a custom template to set up invoke process.
http://msdn.microsoft.com/en-us/library/ff805001(v=vs.100).aspx ( check the invokeprocess part in this link )
Did you try with Build option available in Team explorer?
I have a build project that I run from TeamCity, now it takes the build.number from TeamCity.
I want to be able to use the buildnumber task (Ant) which in my understanding when used, is supposed to change the value of build number property and increment it for next time.
But it seems that I still get the build number from TeamCity.
How can I use the build number from <buildnumber file="mybuild.number"/>?
Use the TeamCity Autoincrementer plugin to share an incrementing build number between configurations.
The ANT buildnumber task sets the ANT property build.number.
I don't use team city, but the documentation states that it is also setting the same property.... Might explain your problem :-(
Perhaps someone knows how to switch this team city feature off.
Is there a good reason to switch? The only alternative I can offer ivy buildnumber task. It calculates the next build/release number based on what was previously published to the repository. This may not be suitable in your case. I prefer it because I don't depend on build server settings or need to keep a property file under revision control.
I'm afraid so far there is no way to disable build.number property from TeamCity.
The only possibility I can imagine is not to use TeamCity Ant runner and use Command-line runner instead. But in this case you'll miss many nicities of the bundled Ant runner (like immediate test reporting).
Why would you want to use buildnumber task of the Ant? To keep build number across the builds, you'd have either to commit mybuild.number to version control or to run the build always on the same agent in the same place.