QualiSystems / FluentTc

:ocean: :two_men_holding_hands: :office: Integrate with TeamCity fluently
https://www.nuget.org/packages/fluenttc
Apache License 2.0
44 stars 35 forks source link

Question about getting running builds #82

Closed epiespen closed 7 years ago

epiespen commented 7 years ago

Running builds

First of all, great work, love FluentTc!

I have created a monitor screen displaying status of latest build of all buildTypes of a Project. Green for success and red for failure. Now I want to add yellow for currently running builds, but I can't figure out how to get that info.

So the question is basically how do I acecss data about any currently running builds and their states?

borismod commented 7 years ago

@epiespen I am glad you like it. Do you mean get list of running builds?

Just getting the basic list of running builds is like this:

            var runningBuilds = new RemoteTc().Connect(a => a.ToHost("tc").AsGuest())
                .GetBuilds(which => which.Running()));

with some additional data:

            var runningBuilds = new RemoteTc().Connect(a => a.ToHost("tc").AsGuest())
                .GetBuilds(which => which.Running(), 
                    include => include.IncludeDefaults().IncludeStartDate());

Please note that there is no status on the running builds, only on finished. Also please note that when a build is "getting source code" it's not considered by TeamCity as running.

borismod commented 7 years ago

with additional data and paging:

            var runningBuilds = new RemoteTc().Connect(a => a.ToHost("tc").AsGuest())
                .GetBuilds(which => which.Running(), 
                    include => include.IncludeDefaults().IncludeStartDate(), 
                    paging => paging.Start(50).Count(10));
epiespen commented 7 years ago

That did the trick! Thanks so much! :) Keep up the good work!

borismod commented 7 years ago

@epiespen I am excited to see your monitor. I am sure it might be useful for many others. Are you going to publish it on github?

epiespen commented 7 years ago

I'll keep it as a private repo until I've got a couple of more things in place :) When I'm happy with the basic features I'll publish it and let you know as well as link to FluentTc in the readme. Thanks again!