Skip to content

Instantly share code, notes, and snippets.

@adoprog
Created June 14, 2013 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adoprog/5782041 to your computer and use it in GitHub Desktop.
Save adoprog/5782041 to your computer and use it in GitHub Desktop.
TeamCity API - Get Artifacts
var buildConfigId = this.Url.RequestContext.RouteData.Values["id"] as string ?? "bt1";
var client = new TeamCityClient("http://your team city server");
// Connect with Guest Authentication
client.Connect(string.Empty, string.Empty, true);
var config = client.BuildConfigByConfigurationId(buildConfigId);
foreach (Build build in client.SuccessfulBuildsByBuildConfigId(buildConfigId).Take(5))
{
var artifacts = client.ArtifactsByBuildConfigIdAndBuildNumber(buildConfigId, build.Number);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment