public override void Run(Context context) { var options = new TeamCityClientOptions { Username = "******", Password = "******", ServerUri = new Uri("http://build.mk6.local") }; //var p = context.TeamCityProjectGet(TeamCityProjectLocatorType.Id, "CakeProvision", options); var p = context.TeamCityProjectCreate(new NewProject { Id = "SampleProject2", Name = "SampleProject2", ParentProject = new NewProjectParent { Locator = "id:CakeProvision" } }, options); }
public static Project TeamCityProjectCreate(this Context context, NewProject newProject, TeamCityClientOptions options) { return(TeamCityProjectCreateAsync(context, newProject, options).Result); }
public static async Task <Project> TeamCityProjectCreateAsync(this Context context, NewProject newProject, TeamCityClientOptions options) { using (var tcc = new TeamCityClient(options)) { return(await tcc.Projects.CreateAsync(newProject)); } }
public static Project TeamCityProjectGet(this Context context, TeamCityProjectLocatorType projectLocatorType, string projectLocatorValue, TeamCityClientOptions options) { return(TeamCityProjectGetAsync(context, projectLocatorType, projectLocatorValue, options).Result); }
public static async Task <Project> TeamCityProjectGetAsync(this Context context, TeamCityProjectLocatorType projectLocatorType, string projectLocatorValue, TeamCityClientOptions options) { using (var tcc = new TeamCityClient(options)) { switch (projectLocatorType) { case TeamCityProjectLocatorType.Id: return(await tcc.Projects.ByIdAsync(projectLocatorValue)); case TeamCityProjectLocatorType.Name: return(await tcc.Projects.ByNameAsync(projectLocatorValue)); default: return(await tcc.Projects.ByLocatorAsync(projectLocatorValue)); } } }