public DeploySchedulerAppDeploymentTask( IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, ITaskScheduler taskScheduler, IPasswordCollector passwordCollector, IDirectoryAdapter directoryAdapter, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter) : base(projectInfoRepository, environmentInfoRepository) { Guard.NotNull(artifactsRepository, "artifactsRepository"); Guard.NotNull(taskScheduler, "taskScheduler"); Guard.NotNull(passwordCollector, "passwordCollector"); Guard.NotNull(directoryAdapter, "directoryAdapter"); Guard.NotNull(fileAdapter, "fileAdapter"); Guard.NotNull(zipFileAdapter, "zipFileAdapter"); _artifactsRepository = artifactsRepository; _taskScheduler = taskScheduler; _passwordCollector = passwordCollector; _directoryAdapter = directoryAdapter; _fileAdapter = fileAdapter; _zipFileAdapter = zipFileAdapter; }
public DeployNtServiceDeploymentTask( IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, INtServiceManager ntServiceManager, IPasswordCollector passwordCollector, IFailoverClusterManager failoverClusterManager, IDirectoryAdapter directoryAdapter, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter) : base(projectInfoRepository, environmentInfoRepository) { Guard.NotNull(artifactsRepository, "artifactsRepository"); Guard.NotNull(ntServiceManager, "ntServiceManager"); Guard.NotNull(passwordCollector, "passwordCollector"); Guard.NotNull(failoverClusterManager, "failoverClusterManager"); Guard.NotNull(directoryAdapter, "directoryAdapter"); Guard.NotNull(fileAdapter, "fileAdapter"); Guard.NotNull(zipFileAdapter, "zipFileAdapter"); _artifactsRepository = artifactsRepository; _ntServiceManager = ntServiceManager; _passwordCollector = passwordCollector; _failoverClusterManager = failoverClusterManager; _directoryAdapter = directoryAdapter; _fileAdapter = fileAdapter; _zipFileAdapter = zipFileAdapter; }
public DeployUberDeployerAgentDeploymentTask( IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, INtServiceManager ntServiceManager, IPasswordCollector passwordCollector, IFailoverClusterManager failoverClusterManager, IDirectoryAdapter directoryAdapter, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter) : base( projectInfoRepository, environmentInfoRepository, artifactsRepository, ntServiceManager, passwordCollector, failoverClusterManager, directoryAdapter, fileAdapter, zipFileAdapter) { Guard.NotNull(directoryAdapter, "directoryAdapter"); _directoryAdapter = directoryAdapter; }
public static string CollectPasssword(IPasswordCollector passwordCollector, Guid deploymentId, EnvironmentInfo environmentInfo, string machineName, EnvironmentUser environmentUser, EventHandler <DiagnosticMessageEventArgs> onDiagnosticMessagePostedAction) { Guard.NotEmpty(deploymentId, "deploymentId"); Guard.NotNull(passwordCollector, "passwordCollector"); Guard.NotNull(environmentInfo, "environmentInfo"); Guard.NotNullNorEmpty(machineName, "machineName"); Guard.NotNull(environmentUser, "environmentUser"); passwordCollector.DiagnosticMessagePosted += onDiagnosticMessagePostedAction; try { string environmentUserPassword = passwordCollector.CollectPasswordForUser( deploymentId, environmentInfo.Name, machineName, environmentUser.UserName); if (string.IsNullOrEmpty(environmentUserPassword)) { throw new InvalidOperationException(string.Format("Couldn't obtain password for user named '{0}' for environment named '{1}'.", environmentUser.UserName, environmentInfo.Name)); } return(environmentUserPassword); } finally { passwordCollector.DiagnosticMessagePosted -= onDiagnosticMessagePostedAction; } }
public DeployNtServiceDeploymentTask( IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, INtServiceManager ntServiceManager, IPasswordCollector passwordCollector, IFailoverClusterManager failoverClusterManager, NtServiceProjectInfo projectInfo, string projectConfigurationName, string projectConfigurationBuildId, string targetEnvironmentName) : base(environmentInfoRepository, targetEnvironmentName) { if (artifactsRepository == null) { throw new ArgumentNullException("artifactsRepository"); } if (ntServiceManager == null) { throw new ArgumentNullException("ntServiceManager"); } if (projectInfo == null) { throw new ArgumentNullException("projectInfo"); } if (string.IsNullOrEmpty(projectConfigurationName)) { throw new ArgumentException("Argument can't be null nor empty.", "projectConfigurationName"); } if (string.IsNullOrEmpty(projectConfigurationBuildId)) { throw new ArgumentException("Argument can't be null nor empty.", "projectConfigurationBuildId"); } if (passwordCollector == null) { throw new ArgumentNullException("passwordCollector"); } if (failoverClusterManager == null) { throw new ArgumentNullException("failoverClusterManager"); } _artifactsRepository = artifactsRepository; _projectInfo = projectInfo; _projectConfigurationName = projectConfigurationName; _projectConfigurationBuildId = projectConfigurationBuildId; _ntServiceManager = ntServiceManager; _passwordCollector = passwordCollector; _failoverClusterManager = failoverClusterManager; }
public DeploySchedulerAppDeploymentTask( IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, ITaskScheduler taskScheduler, IPasswordCollector passwordCollector, SchedulerAppProjectInfo projectInfo, string projectConfigurationName, string projectConfigurationBuildId, string targetEnvironmentName) : base(environmentInfoRepository, targetEnvironmentName) { if (artifactsRepository == null) { throw new ArgumentNullException("artifactsRepository"); } if (taskScheduler == null) { throw new ArgumentNullException("taskScheduler"); } if (passwordCollector == null) { throw new ArgumentNullException("passwordCollector"); } if (projectInfo == null) { throw new ArgumentNullException("projectInfo"); } if (string.IsNullOrEmpty(projectConfigurationName)) { throw new ArgumentException("Argument can't be null nor empty.", "projectConfigurationName"); } if (string.IsNullOrEmpty(projectConfigurationBuildId)) { throw new ArgumentException("Argument can't be null nor empty.", "projectConfigurationBuildId"); } _artifactsRepository = artifactsRepository; _taskScheduler = taskScheduler; _passwordCollector = passwordCollector; _projectInfo = projectInfo; _projectConfigurationName = projectConfigurationName; _projectConfigurationBuildId = projectConfigurationBuildId; }
public static string CollectPasssword(IPasswordCollector passwordCollector, EnvironmentInfo environmentInfo, string machineName, string userId, out EnvironmentUser environmentUser) { if (passwordCollector == null) { throw new ArgumentNullException("passwordCollector"); } if (environmentInfo == null) { throw new ArgumentNullException("environmentInfo"); } if (string.IsNullOrEmpty(machineName)) { throw new ArgumentException("Argument can't be null nor empty.", "machineName"); } if (string.IsNullOrEmpty(userId)) { throw new ArgumentException("Argument can't be null nor empty.", "userId"); } environmentUser = environmentInfo.GetEnvironmentUserByName(userId); if (environmentUser == null) { throw new InvalidOperationException(string.Format("There's no environment user with id '{0}' defined in environment named '{1}'.", userId, environmentInfo.Name)); } string environmentUserPassword = passwordCollector.CollectPasswordForUser( environmentInfo.Name, machineName, environmentUser.UserName); if (string.IsNullOrEmpty(environmentUserPassword)) { throw new InvalidOperationException(string.Format("Couldn't obtain password for user named '{0}' for environment named '{1}'.", environmentUser.UserName, environmentInfo.Name)); } return environmentUserPassword; }
public DeployUberDeployerAgentDeploymentTask( IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IArtifactsRepository artifactsRepository, INtServiceManager ntServiceManager, IPasswordCollector passwordCollector, IFailoverClusterManager failoverClusterManager, IDirectoryAdapter directoryAdapter, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter) : base(projectInfoRepository, environmentInfoRepository, artifactsRepository, ntServiceManager, passwordCollector, failoverClusterManager, directoryAdapter, fileAdapter, zipFileAdapter) { Guard.NotNull(directoryAdapter, "directoryAdapter"); _directoryAdapter = directoryAdapter; }