public static void Main(string[] args) { Console.WriteLine ("Starting Cydin service"); SetProcessName ("cydind"); BuildService buildBot = new BuildService (); buildBot.Start (null); Console.WriteLine ("Running"); }
public override void Fetch(BuildContext ctx, int sourceId, SourceTagInfo stag, StringBuilder output, StringBuilder error) { string command; string args; string targetPath = GetSourceTagPath(ctx, sourceId, stag.Id); Util.ResetFolder(targetPath); command = SubversionCommand; args = "export --force " + stag.Url + " \"" + targetPath + "\""; output.AppendLine(command + " " + args); BuildService.RunCommand(false, command, args, output, error, Timeout); }
public override IEnumerable <SourceTagInfo> GetChildUrls(BuildContext ctx, SourceInfo source) { StringBuilder output = new StringBuilder(); StringBuilder error = new StringBuilder(); string url = source.Url; if (!url.EndsWith("/*")) { BuildService.RunCommand(false, SubversionCommand, "info --xml " + url, output, error, Timeout); XmlDocument doc = new XmlDocument(); doc.LoadXml(output.ToString()); XmlElement elem = (XmlElement)doc.SelectSingleNode("/info/entry"); if (elem == null) { elem = (XmlElement)doc.SelectSingleNode("/info"); if (elem != null) { throw new Exception(elem.InnerText); } else if (error.Length > 0) { throw new Exception(error.ToString()); } else { throw new Exception("Error while getting repository information"); } } yield return(new SourceTagInfo() { Url = url, Name = elem.GetAttribute("path"), LastRevision = elem.GetAttribute("revision") }); } else { url = url.Substring(0, url.Length - 2); BuildService.RunCommand(false, SubversionCommand, "ls --xml " + url, output, error, Timeout); XmlDocument doc = new XmlDocument(); try { doc.LoadXml(output.ToString()); } catch { if (error.Length > 0) { throw new Exception(error.ToString()); } else { throw new Exception("Error while getting repository information"); } } foreach (XmlElement elem in doc.SelectNodes("/lists/list/entry")) { string name = elem["name"].InnerText; string revision = elem["commit"].GetAttribute("revision"); yield return(new SourceTagInfo() { Url = url + "/" + name, Name = name, LastRevision = revision }); } } }