public OctopusDeploymentProvider( IConfigurationSettings settings, ILogger logger, IBuildMatcher buildMatcher, IFluentCommandLineParser parser, IUsernameTransformer usernameTransformer) : base(logger, settings) { _buildMatcher = buildMatcher; _usernameTransformer = usernameTransformer; SetupOption(parser, "octopusUrl", "The server URL of the Octopus Deploy server to use.", "Octopus.ServerUrl", data => _serverAddress = data); SetupOption(parser, "octopusApiKey", "The API Key of the Octopus Deploy server to use.", "Octopus.ApiKey", data => _apiKey = data); SetupOption(parser, "octopusEnv", "The Octopus envrionment to validate, defaults to Prod", "Octopus.ProdEnvName", data => _environmentName = data); }
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); }