Ejemplo n.º 1
0
        private void WaitOrFail(string buildUri)
        {
            DateTime startTime = DateTime.Now;

            while (true)
            {
                #region Tracing
#line hidden
                if (ChangesetWatcher.m_TraceSwitch.TraceVerbose)
                {
                    Trace.TraceInformation(
                        "Getting build status for build URI '{0}'.",
                        buildUri
                        );
                }
#line default
                #endregion

                BuildStore store = this.GetService <BuildStore>();
                BuildData  data  = store.GetBuildDetails(buildUri);
                if ((data.BuildStatus == Microsoft.TeamFoundation.Build.Common.BuildConstants.BuildStatus.BuildSucceeded) ||
                    (data.BuildStatus == Microsoft.TeamFoundation.Build.Common.BuildConstants.BuildStatus.BuildStopped) ||
                    (data.BuildStatus == Microsoft.TeamFoundation.Build.Common.BuildConstants.BuildStatus.BuildFailed))
                {
                    return;
                }

                if (this.IsBuildTakingTooLong(startTime))
                {
                    throw new Exception("Build is taking too long.");
                }

                Thread.Sleep(5000);
            }
        }
Ejemplo n.º 2
0
        private static BuildData GetBuild(string teamProject, string buildId)
        {
            BuildStore store    = ServiceHelper.GetService <BuildStore>();
            string     buildUri = store.GetBuildUri(teamProject, buildId);
            BuildData  bd       = store.GetBuildDetails(buildUri);

            return(bd);
        }