Ejemplo n.º 1
0
 private string[] GetTeamProjectsInternal()
 {
     using (var collection = TfsActionBase.GetTeamProjectCollection(this))
     {
         var structureService = collection.GetService <ICommonStructureService>();
         return(structureService.ListProjects().Select(p => p.Name).ToArray());
     }
 }
Ejemplo n.º 2
0
 private string[] GetBuildDefinitionsInternal(string teamProject)
 {
     using (var collection = TfsActionBase.GetTeamProjectCollection(this))
     {
         var buildService = collection.GetService <IBuildServer>();
         return(buildService.QueryBuildDefinitions(teamProject).Select(d => d.Name).ToArray());
     }
 }
Ejemplo n.º 3
0
        private string TestConnectionInternal()
        {
            try
            {
                using (var collection = TfsActionBase.GetTeamProjectCollection(this))
                {
                    collection.EnsureAuthenticated();
                }

                return(null);
            }
            catch (Exception ex)
            {
                return(ex.Message);
            }
        }
Ejemplo n.º 4
0
        private TfsBuildInfo GetBuildInfoInternal(string teamProject, string buildDefinition, string buildNumber, bool includeUnsuccessful)
        {
            using (var collection = TfsActionBase.GetTeamProjectCollection(this))
            {
                var buildService = collection.GetService <IBuildServer>();

                var spec = buildService.CreateBuildDetailSpec(teamProject, AH.CoalesceString(buildDefinition, "*"));
                spec.BuildNumber            = AH.CoalesceString(buildNumber, "*");
                spec.MaxBuildsPerDefinition = 1;
                spec.QueryOrder             = BuildQueryOrder.FinishTimeDescending;
                spec.Status = includeUnsuccessful ? (BuildStatus.Failed | BuildStatus.Succeeded | BuildStatus.PartiallySucceeded) : BuildStatus.Succeeded;

                var result = buildService.QueryBuilds(spec).Builds.FirstOrDefault();
                if (result != null)
                {
                    return(new TfsBuildInfo(result));
                }
                else
                {
                    return(null);
                }
            }
        }