public OctopusProductionDeployment(IProject project, DeploymentResource deployment, ReleaseResource release, ResourceCollection <EventResource> deploymentEvents, IProductionDeployment previousDeployment, IUsernameTransformer usernameTransformer) { // Octopus Objects Deployment = deployment; Release = release; DeploymentEvents = deploymentEvents; // Common fields DeploymentProject = project; Id = deployment.Id; Name = deployment.Name; DeployDate = deployment.Created.DateTime; PreviousDeployment = previousDeployment; ReleaseNotes = release.ReleaseNotes; Users = new HashSet <string>(deploymentEvents.Items.Select(e => usernameTransformer.GetEmailAddress(e.Username)), StringComparer.InvariantCultureIgnoreCase); }
public bool FindMatchingBuild(IProductionDeployment deployment) { if (string.IsNullOrWhiteSpace(deployment.ReleaseNotes)) { _logger.WriteError("Deployment has no release notes, cannot match build"); return(false); } var match = _releaseLocateRegex.Match(deployment.ReleaseNotes); if (!match.Success) { _logger.WriteError("Cannot locate build for Id in release"); return(false); } deployment.BuildNumber = match.Groups["buildnumber"].Value.Trim(); deployment.BuildName = match.Groups["buildname"].Value.Trim(); return(true); }
internal void MarkPreviousDeployment(IProductionDeployment previousDeployment) { PreviousDeployment = previousDeployment; }