示例#1
0
            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);
        }
示例#3
0
 internal void MarkPreviousDeployment(IProductionDeployment previousDeployment)
 {
     PreviousDeployment = previousDeployment;
 }