protected string NegotiateProjectName(string projectName, Branch branch) { if(branch != null && !branch.IsMaster && !string.IsNullOrEmpty(branch.Name)) return string.Format(ConfigurationSettings.AppSettings["BuildProjectNameFormat"], projectName, branch.Name); else return projectName; }
protected string NegotiateProjectName(string projectName, Branch branch) { if(branch != null && !branch.IsMaster && !string.IsNullOrEmpty(branch.Name)) return string.Concat(projectName, "/", branch.Name); else return projectName; }
public override void ForceBuild(string projectName, Branch branch) { projectName = NegotiateProjectName(projectName, branch); HttpWebRequest wr = WebRequest.Create(string.Concat(Url, "/ViewFarmReport.aspx")) as HttpWebRequest; wr.Method = "post"; wr.ContentType = "application/x-www-form-urlencoded"; if (this.Credentials != null) wr.Credentials = this.Credentials; string body = string.Format("ForceBuild=true&projectName={0}&serverName={1}", projectName, this.Server); byte[] bodyBytes = Encoding.UTF8.GetBytes(body); wr.ContentLength = bodyBytes.Length; using (var dataStream = wr.GetRequestStream()) { dataStream.Write(bodyBytes, 0, bodyBytes.Length); dataStream.Close(); } wr.GetResponse(); }
public override void ForceBuild(string projectName, Branch branch) { projectName = NegotiateProjectName(projectName, branch); Open("/ViewFarmReport.aspx").Request(projectName, new IntegrationRequest(BuildCondition.ForceBuild, Source, User)); }
public abstract void ForceBuild(string projectName, Branch branch);