static void Main(string[] args) { if (args.Count() == 6) { string teamCityUrl = args[0].Trim(); string userName = args[1].Trim(); string password = args[2].Trim(); string buildId = args[3].Trim(); string assemblyPath = args[4].Trim(); string prefix = args[5].Trim(); TCConnection tcConnection = new TCConnection(teamCityUrl, userName, password); if (!String.IsNullOrEmpty(assemblyPath)) { Assembly assembly = Assembly.LoadFrom(assemblyPath); if (assembly != null) { Version ver = assembly.GetName().Version; tcConnection.AddBuildTags(buildId, nTeamCity.Core.Locators.Locator.ById, String.Concat(prefix, ver.ToString())); } } else { Console.WriteLine("Invalid assembly"); } } else { Console.WriteLine("Invalid arguments"); Console.WriteLine("TCAssemblyTagger.exe <url> <username> <password> <buildId> <assemblyPath> <tagPrefix>"); } }
public void TestAddTags() { tcConnection = new TCConnection("http://192.168.137.49", "admin", "admin"); tcConnection.AddBuildTags("20", Core.Locators.Locator.ById, "TAG1", "TAG2"); }