Manually run the TFS Team build

How do you manually run additional teams from a team? For example, when we were in CC.Net, other assemblies would be launched if certain assemblies were successful. The second assembly can be either projects using this component, or additional, durable test libraries for the same component.

+5
source share
2 answers

One way to do this is to use the AfterEndToEndIteration object for your TFSBuild.proj file, which will run the TfsBuild.exe command line to start other assemblies. I think something like this (although I have not tested it)

  <Target Name="AfterEndToEndIteration">

    <GetBuildProperties TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
                        BuildUri="$(BuildUri)"
                        Condition=" '$(IsDesktopBuild)' != 'true' ">
      <Output TaskParameter="Status" PropertyName="Status" />
    </GetBuildProperties>

    <Exec Condition=" '$(Status)'=='Succeeded' "
          Command="TfsBuild.exe start /server:$(TeamFoundationServerUrl) /buildDefinition:&quot;Your Build Definition To Run&quot;" />

  </Target>
+4

, ( , BTW). , ( ), . .

    public override bool Execute()
    {       
        IBuildDefinition[] buildDefinitions = BuildServer.QueryBuildDefinitions(ProjectName);

        foreach (IBuildDefinition build in buildDefinitions)
        {
            if(build.Enabled) //I did a bunch of custom rules here
            {
                Log.LogMessage(String.Concat("Queuing build: ", build.Name));
                BuildServer.QueueBuild(build);
            }
        }

        return true;
    }

:

http://blogs.msdn.com/aaronhallberg/archive/2007/04/24/team-build-object-model-queueing-a-build.aspx

+3

All Articles