Queue a build and wait for it to finish

Oct 31, 2013 at 12:04 PM
Hi, I need to make one build run from another but I need to make sure that the build continues after the inner build finished. the inner build is compiling DLL's and then checks them in to the TFS. the outer build needs to take the build outputs from the TFS and use them to compile the code it has.
Is there a way to make the outer build wait for the inner build?
Coordinator
Mar 1, 2014 at 7:13 PM
Add a reference to the lab activities
xmlns:mtlwa="clr-namespace:Microsoft.TeamFoundation.Lab.Workflow.Activities;assembly=Microsoft.TeamFoundation.Lab.Workflow.Activities"
then you'd do something similar to below
<!-- Queue your build -->
<Assign x:TypeArguments="mtbc:IQueuedBuild"  DisplayName="Queue build" mtbwt:BuildTrackingParticipant.Importance="None" To="[YourQueuedBuild]" Value="[BuildServer.QueueBuild(YourBuildRequest)]"/>

<!-- Wait for it -->
<mtlwa:WaitForWorkflow AllowPartiallySucceededBuild="True" 
                       BuildDetails="[YourBuildDetail]"
                       DisplayName="Wait For Build To Complete"
                       LabWorkflowType="[Microsoft.TeamFoundation.Lab.Workflow.Activities.WorkflowType.Build]"
                       MaxConsecutiveFailuresToIgnoreDuringWaitForCompletion="[3]"
                       MaxWaitTime="[TimeSpan.Zero]"
                       QueueBuildId="[YourQueuedBuild.Id]"
                       RefreshInterval="[System.TimeSpan.FromSeconds(20)]"
                       Result="[YourBuildStatus]" ThrowOnError="True"/>
Marked as answer by mikeFourie on 3/7/2014 at 2:03 PM