Ejemplo n.º 1
0
        public DeployDependenciesTask(
            string projectName,
            string targetEnvironment,
            Guid deploymentId,
            IProjectInfoRepository projectInfoRepository,
            IObjectFactory objectFactory,
            ITeamCityRestClient temCityRestClient,
            IDependentProjectsToDeployWebSelector dependentProjectsToDeploySelector)
        {
            Guard.NotNullNorEmpty(projectName, "projectName");
            Guard.NotNullNorEmpty(targetEnvironment, "targetEnvironment");
            Guard.NotEmpty(deploymentId, "deploymentId");
            Guard.NotNull(projectInfoRepository, "projectInfoRepository");
            Guard.NotNull(objectFactory, "objectFactory");
            Guard.NotNull(temCityRestClient, "temCityRestClient");
            Guard.NotNull(dependentProjectsToDeploySelector, "dependentProjectsToDeploySelector");

            _projectName                       = projectName;
            _targetEnvironment                 = targetEnvironment;
            _deploymentId                      = deploymentId;
            _projectInfoRepository             = projectInfoRepository;
            _objectFactory                     = objectFactory;
            _temCityRestClient                 = temCityRestClient;
            _dependentProjectsToDeploySelector = dependentProjectsToDeploySelector;

            _subTasks = new List <DeploymentTaskBase>();
        }
        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;
        }
Ejemplo n.º 3
0
        protected override void ExecuteTask()
        {
            try
            {
                IProjectInfoRepository projectInfoRepository = ObjectFactory.Instance.CreateProjectInfoRepository();
                ProjectInfo            projectInfo           = projectInfoRepository.FindByName(ProjectName);
                DeploymentTask         deploymentTask        = projectInfo.CreateDeploymentTask(ObjectFactory.Instance);

                IDeploymentPipeline deploymentPipeline =
                    ObjectFactory.Instance.CreateDeploymentPipeline();

                deploymentPipeline.DiagnosticMessagePosted +=
                    (eventSender, tmpArgs) => Log(Level.Info, tmpArgs.Message);

                var deploymentContext = new DeploymentContext(RequesterIdentity);

                Guid deploymentId = Guid.NewGuid();

                var deploymentInfo =
                    new DeploymentInfo(
                        deploymentId,
                        IsSimulation,
                        ProjectName,
                        ConfigurationName,
                        BuildId,
                        Environment,
                        projectInfo.CreateEmptyInputParams());

                deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext);
            }
            catch (Exception exc)
            {
                Log(Level.Error, "Error: " + exc);
            }
        }
        public DeployWebAppDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IMsDeploy msDeploy,
            IArtifactsRepository artifactsRepository,
            IIisManager iisManager,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IApplicationConfiguration applicationConfiguration,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(msDeploy, "msDeploy");
              Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNull(iisManager, "iisManager");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");
              Guard.NotNull(directoryAdapter, "directoryAdapter");

              _msDeploy = msDeploy;
              _artifactsRepository = artifactsRepository;
              _iisManager = iisManager;
              _fileAdapter = fileAdapter;
              _zipFileAdapter = zipFileAdapter;
              _applicationConfiguration = applicationConfiguration;
              _directoryAdapter = directoryAdapter;
        }
Ejemplo n.º 5
0
        public DeployWebAppDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IMsDeploy msDeploy,
            IArtifactsRepository artifactsRepository,
            IIisManager iisManager,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IApplicationConfiguration applicationConfiguration,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(msDeploy, "msDeploy");
            Guard.NotNull(artifactsRepository, "artifactsRepository");
            Guard.NotNull(iisManager, "iisManager");
            Guard.NotNull(fileAdapter, "fileAdapter");
            Guard.NotNull(zipFileAdapter, "zipFileAdapter");
            Guard.NotNull(directoryAdapter, "directoryAdapter");

            _msDeploy                 = msDeploy;
            _artifactsRepository      = artifactsRepository;
            _iisManager               = iisManager;
            _fileAdapter              = fileAdapter;
            _zipFileAdapter           = zipFileAdapter;
            _applicationConfiguration = applicationConfiguration;
            _directoryAdapter         = directoryAdapter;
        }
        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 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;
        }
Ejemplo n.º 8
0
        private readonly ITeamCityClient _teamCityClient; // TODO IMM HI: abstract away?

        #endregion Fields

        #region Constructors

        public AgentService(
            IDeploymentPipeline deploymentPipeline,
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            ITeamCityClient teamCityClient,
            IDeploymentRequestRepository deploymentRequestRepository,
            IDiagnosticMessagesLogger diagnosticMessagesLogger,
            IProjectMetadataExplorer projectMetadataExplorer,
            IDirPathParamsResolver dirPathParamsResolver)
        {
            Guard.NotNull(deploymentPipeline, "deploymentPipeline");
              Guard.NotNull(projectInfoRepository, "projectInfoRepository");
              Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");
              Guard.NotNull(teamCityClient, "teamCityClient");
              Guard.NotNull(deploymentRequestRepository, "deploymentRequestRepository");
              Guard.NotNull(diagnosticMessagesLogger, "diagnosticMessagesLogger");
              Guard.NotNull(dirPathParamsResolver, "dirPathParamsResolver");

              _projectInfoRepository = projectInfoRepository;
              _environmentInfoRepository = environmentInfoRepository;
              _teamCityClient = teamCityClient;
              _deploymentPipeline = deploymentPipeline;
              _deploymentRequestRepository = deploymentRequestRepository;
              _diagnosticMessagesLogger = diagnosticMessagesLogger;
              _projectMetadataExplorer = projectMetadataExplorer;
              _dirPathParamsResolver = dirPathParamsResolver;
        }
Ejemplo n.º 9
0
        public DeployDependenciesTask(
      string projectName,
      string targetEnvironment,
      Guid deploymentId,
      IProjectInfoRepository projectInfoRepository,
      IObjectFactory objectFactory,
      ITeamCityRestClient temCityRestClient,
      IDependentProjectsToDeployWebSelector dependentProjectsToDeploySelector)
        {
            Guard.NotNullNorEmpty(projectName, "projectName");
              Guard.NotNullNorEmpty(targetEnvironment, "targetEnvironment");
              Guard.NotEmpty(deploymentId, "deploymentId");
              Guard.NotNull(projectInfoRepository, "projectInfoRepository");
              Guard.NotNull(objectFactory, "objectFactory");
              Guard.NotNull(temCityRestClient, "temCityRestClient");
              Guard.NotNull(dependentProjectsToDeploySelector, "dependentProjectsToDeploySelector");

              _projectName = projectName;
              _targetEnvironment = targetEnvironment;
              _deploymentId = deploymentId;
              _projectInfoRepository = projectInfoRepository;
              _objectFactory = objectFactory;
              _temCityRestClient = temCityRestClient;
              _dependentProjectsToDeploySelector = dependentProjectsToDeploySelector;

              _subTasks = new List<DeploymentTaskBase>();
        }
        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;
        }
Ejemplo n.º 11
0
        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;
        }
Ejemplo n.º 12
0
 public PlanViewProjectsController(ILogger <PlanViewProjectsController> logger,
                                   //IMailService mailService,
                                   IProjectInfoRepository ProjectInfoRepository)
 {
     _logger = logger;
     //_mailService = mailService;
     _ProjectInfoRepository = ProjectInfoRepository;
 }
Ejemplo n.º 13
0
        protected DeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository)
        {
            Guard.NotNull(projectInfoRepository, "projectInfoRepository");
            Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");

            _projectInfoRepository     = projectInfoRepository;
            _environmentInfoRepository = environmentInfoRepository;

            _subTasks = new List <DeploymentTaskBase>();
        }
        public DropDbProjectDeploymentTask(
      IProjectInfoRepository projectInfoRepository,
      IEnvironmentInfoRepository environmentInfoRepository,
      IDbManagerFactory dbManagerFactory)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(dbManagerFactory, "dbManagerFactory");

              _dbManagerFactory = dbManagerFactory;
        }
        public PlanViewProjectsController(ILogger <PlanViewProjectsController> logger,

                                          IProjectInfoRepository ProjectInfoRepository,
                                          IMapper mapper)
        {
            _logger = logger;
            //_mailService = mailService;
            _ProjectInfoRepository = ProjectInfoRepository;
            _mapper = mapper;
        }
Ejemplo n.º 16
0
        public ProjectMetadataExplorer(IObjectFactory objectFactory, IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IDbVersionProvider dbVersionProvider)
        {
            Guard.NotNull(objectFactory, "objectFactory");
              Guard.NotNull(projectInfoRepository, "projectInfoRepository");
              Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");
              Guard.NotNull(dbVersionProvider, "dbVersionProvider");

              _objectFactory = objectFactory;
              _projectInfoRepository = projectInfoRepository;
              _environmentInfoRepository = environmentInfoRepository;
              _dbVersionProvider = dbVersionProvider;
        }
Ejemplo n.º 17
0
        public override int Run(string[] args)
        {
            if (args.Length != 2)
            {
                DisplayCommandUsage();

                return(1);
            }

            string projectName = args[0];
            string projectConfigurationName = args[1];

            IProjectInfoRepository projectInfoRepository =
                ObjectFactory.Instance.CreateProjectInfoRepository();

            ProjectInfo projectInfo = projectInfoRepository.FindByName(projectName);

            if (projectInfo == null)
            {
                OutputWriter.WriteLine("Project named '{0}' doesn't exist.", projectName);
                return(1);
            }

            ITeamCityClient teamCityClient =
                ObjectFactory.Instance.CreateTeamCityClient();

            Project        project        = teamCityClient.GetProjectByName(projectInfo.ArtifactsRepositoryName);
            ProjectDetails projectDetails = teamCityClient.GetProjectDetails(project);

            ProjectConfiguration projectConfiguration =
                projectDetails.ConfigurationsList.Configurations
                .SingleOrDefault(pc => pc.Name == projectConfigurationName);

            if (projectConfiguration == null)
            {
                OutputWriter.WriteLine("Project configuration named '{0}' doesn't exist for project '{1}'.", projectConfigurationName, projectName);

                return(1);
            }

            ProjectConfigurationDetails projectConfigurationDetails =
                teamCityClient.GetProjectConfigurationDetails(projectConfiguration);

            ProjectConfigurationBuildsList projectConfigurationBuildsList =
                teamCityClient.GetProjectConfigurationBuilds(projectConfigurationDetails, 0, _MaxProjectConfigurationBuildsCount);

            foreach (ProjectConfigurationBuild projectConfigurationBuild in projectConfigurationBuildsList.Builds)
            {
                OutputWriter.WriteLine("{0}\t{1}", projectConfigurationBuild.Id, projectConfigurationBuild.Status);
            }

            return(0);
        }
Ejemplo n.º 18
0
        public ProjectMetadataExplorer(IObjectFactory objectFactory, IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IDbVersionProvider dbVersionProvider)
        {
            Guard.NotNull(objectFactory, "objectFactory");
            Guard.NotNull(projectInfoRepository, "projectInfoRepository");
            Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");
            Guard.NotNull(dbVersionProvider, "dbVersionProvider");

            _objectFactory             = objectFactory;
            _projectInfoRepository     = projectInfoRepository;
            _environmentInfoRepository = environmentInfoRepository;
            _dbVersionProvider         = dbVersionProvider;
        }
        public override int Run(string[] args)
        {
            if (args.Length > 1)
            {
                DisplayCommandUsage();

                return(1);
            }

            ProjectType?projectType = null;

            if (args.Length == 1)
            {
                projectType = (ProjectType)Enum.Parse(typeof(ProjectType), args[0], true);
            }

            IProjectInfoRepository projectInfoRepository =
                ObjectFactory.Instance.CreateProjectInfoRepository();

            IEnumerable <IGrouping <ProjectType, ProjectInfo> > projectsByType =
                projectInfoRepository.GetAll()
                .GroupBy(pi => pi.Type)
                .OrderBy(infos => infos.Key);

            int count = projectsByType.Count();
            int index = 0;

            foreach (IGrouping <ProjectType, ProjectInfo> projectGrouping in projectsByType)
            {
                ProjectType currentProjecType = projectGrouping.Key;

                if (!projectType.HasValue || currentProjecType == projectType.Value)
                {
                    OutputWriter.WriteLine("{0}:", currentProjecType);

                    foreach (ProjectInfo projectInfo in projectGrouping)
                    {
                        OutputWriter.WriteLine("  {0}", projectInfo.Name);
                    }
                }

                index++;

                if (!projectType.HasValue && index < count)
                {
                    OutputWriter.WriteLine();
                }
            }

            return(0);
        }
Ejemplo n.º 20
0
 //  private readonly IUnitOfWork unitOfWork;
 public ProjectInfoService(IProjectInfoRepository ProjectInfoRepository, IMapper mapper
                           , ISysUserService ISysUserServices, IFillFormService fillFormService
                           , IQuestionsService QuestionsServices, IConversationService ConversationService
                           , ILogger <ProjectInfoService> logger, IRegisterInfoService RegisterInfoService
                           )
 {
     _ProjectInfoRepository = ProjectInfoRepository;
     base.BaseDal           = ProjectInfoRepository;
     _ISysUserServices      = ISysUserServices;
     _FillFormService       = fillFormService;
     _QuestionsServices     = QuestionsServices;
     _ConversationService   = ConversationService;
     _RegisterInfoService   = RegisterInfoService;
     _logger = logger;
     _Mapper = mapper;
 }
        public DeployPowerShellScriptDeploymentTask(
      IProjectInfoRepository projectInfoRepository, 
      IEnvironmentInfoRepository environmentInfoRepository,
      IArtifactsRepository artifactsRepository,
      IFileAdapter fileAdapter,
      IDirectoryAdapter directoryAdapter, 
      IZipFileAdapter zipFileAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(directoryAdapter, "directoryAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");

              _artifactsRepository = artifactsRepository;
              _fileAdapter = fileAdapter;
              _directoryAdapter = directoryAdapter;
              _zipFileAdapter = zipFileAdapter;
        }
        public DeployPowerShellScriptDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IArtifactsRepository artifactsRepository,
            IFileAdapter fileAdapter,
            IDirectoryAdapter directoryAdapter,
            IZipFileAdapter zipFileAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
            Guard.NotNull(fileAdapter, "fileAdapter");
            Guard.NotNull(directoryAdapter, "directoryAdapter");
            Guard.NotNull(zipFileAdapter, "zipFileAdapter");

            _artifactsRepository = artifactsRepository;
            _fileAdapter         = fileAdapter;
            _directoryAdapter    = directoryAdapter;
            _zipFileAdapter      = zipFileAdapter;
        }
Ejemplo n.º 23
0
        private readonly ITeamCityClient _teamCityClient; // TODO IMM HI: abstract away?

        #endregion Fields

        #region Constructors

        public AgentService(IDeploymentPipeline deploymentPipeline, IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, ITeamCityClient teamCityClient, IDeploymentRequestRepository deploymentRequestRepository, IDiagnosticMessagesLogger diagnosticMessagesLogger)
        {
            if (deploymentPipeline == null)
              {
            throw new ArgumentNullException("deploymentPipeline");
              }

              if (projectInfoRepository == null)
              {
            throw new ArgumentNullException("projectInfoRepository");
              }

              if (environmentInfoRepository == null)
              {
            throw new ArgumentNullException("environmentInfoRepository");
              }

              if (teamCityClient == null)
              {
            throw new ArgumentNullException("teamCityClient");
              }

              if (deploymentRequestRepository == null)
              {
            throw new ArgumentNullException("deploymentRequestRepository");
              }

              if (diagnosticMessagesLogger == null)
              {
            throw new ArgumentNullException("diagnosticMessagesLogger");
              }

              _projectInfoRepository = projectInfoRepository;
              _environmentInfoRepository = environmentInfoRepository;
              _teamCityClient = teamCityClient;
              _deploymentPipeline = deploymentPipeline;
              _deploymentRequestRepository = deploymentRequestRepository;
              _diagnosticMessagesLogger = diagnosticMessagesLogger;
        }
        public CreateManualDeploymentPackageDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IArtifactsRepository artifactsRepository,
            IDirectoryAdapter directoryAdapter,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            string packageDirPath)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
            Guard.NotNullNorEmpty(packageDirPath, "packageDirPath");
            Guard.NotNull(directoryAdapter, "directoryAdapter");
            Guard.NotNull(fileAdapter, "fileAdapter");
            Guard.NotNull(zipFileAdapter, "zipFileAdapter");

            _artifactsRepository = artifactsRepository;
            _directoryAdapter    = directoryAdapter;
            _fileAdapter         = fileAdapter;
            _zipFileAdapter      = zipFileAdapter;
            PackageDirPath       = packageDirPath;
        }
        public DeployDbProjectDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IArtifactsRepository artifactsRepository,
            IDbScriptRunnerFactory dbScriptRunnerFactory,
            IDbVersionProvider dbVersionProvider,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNull(dbVersionProvider, "dbVersionProvider");
              Guard.NotNull(dbScriptRunnerFactory, "dbScriptRunnerFactory");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");

              _artifactsRepository = artifactsRepository;
              _dbScriptRunnerFactory = dbScriptRunnerFactory;
              _dbVersionProvider = dbVersionProvider;
              _fileAdapter = fileAdapter;
              _zipFileAdapter = zipFileAdapter;
        }
        public CreateManualDeploymentPackageDeploymentTask(
      IProjectInfoRepository projectInfoRepository,
      IEnvironmentInfoRepository environmentInfoRepository,
      IArtifactsRepository artifactsRepository,
      IDirectoryAdapter directoryAdapter,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            string packageDirPath)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNullNorEmpty(packageDirPath, "packageDirPath");
              Guard.NotNull(directoryAdapter, "directoryAdapter");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");

              _artifactsRepository = artifactsRepository;
              _directoryAdapter = directoryAdapter;
              _fileAdapter = fileAdapter;
              _zipFileAdapter = zipFileAdapter;
              PackageDirPath = packageDirPath;
        }
Ejemplo n.º 27
0
        public DeployDbProjectDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IArtifactsRepository artifactsRepository,
            IDbScriptRunnerFactory dbScriptRunnerFactory,
            IDbVersionProvider dbVersionProvider,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IScriptsToRunSelector createScriptsToRunSelector,
            IMsSqlDatabasePublisher databasePublisher,
            IDbManagerFactory dbManagerFactory,
            IUserNameNormalizer userNameNormalizer,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
            Guard.NotNull(dbVersionProvider, "dbVersionProvider");
            Guard.NotNull(dbScriptRunnerFactory, "dbScriptRunnerFactory");
            Guard.NotNull(fileAdapter, "fileAdapter");
            Guard.NotNull(zipFileAdapter, "zipFileAdapter");
            Guard.NotNull(createScriptsToRunSelector, "createScriptsToRunWebSelector");
            Guard.NotNull(databasePublisher, "databasePublisher");
            Guard.NotNull(dbManagerFactory, "dbManagerFactory");
            Guard.NotNull(userNameNormalizer, "userNameNormalizer");
            Guard.NotNull(directoryAdapter, "directoryAdapter");

            _artifactsRepository        = artifactsRepository;
            _dbScriptRunnerFactory      = dbScriptRunnerFactory;
            _dbVersionProvider          = dbVersionProvider;
            _fileAdapter                = fileAdapter;
            _zipFileAdapter             = zipFileAdapter;
            _createScriptsToRunSelector = createScriptsToRunSelector;
            _databasePublisher          = databasePublisher;
            _dbManagerFactory           = dbManagerFactory;
            _userNameNormalizer         = userNameNormalizer;
            _directoryAdapter           = directoryAdapter;
        }
        public DeployDbProjectDeploymentTask(
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            IArtifactsRepository artifactsRepository,
            IDbScriptRunnerFactory dbScriptRunnerFactory,
            IDbVersionProvider dbVersionProvider,
            IFileAdapter fileAdapter,
            IZipFileAdapter zipFileAdapter,
            IScriptsToRunSelector createScriptsToRunSelector,
            IMsSqlDatabasePublisher databasePublisher,
            IDbManagerFactory dbManagerFactory,
            IUserNameNormalizer userNameNormalizer,
            IDirectoryAdapter directoryAdapter)
            : base(projectInfoRepository, environmentInfoRepository)
        {
            Guard.NotNull(artifactsRepository, "artifactsRepository");
              Guard.NotNull(dbVersionProvider, "dbVersionProvider");
              Guard.NotNull(dbScriptRunnerFactory, "dbScriptRunnerFactory");
              Guard.NotNull(fileAdapter, "fileAdapter");
              Guard.NotNull(zipFileAdapter, "zipFileAdapter");
              Guard.NotNull(createScriptsToRunSelector, "createScriptsToRunWebSelector");
              Guard.NotNull(databasePublisher, "databasePublisher");
              Guard.NotNull(dbManagerFactory, "dbManagerFactory");
              Guard.NotNull(userNameNormalizer, "userNameNormalizer");
              Guard.NotNull(directoryAdapter, "directoryAdapter");

              _artifactsRepository = artifactsRepository;
              _dbScriptRunnerFactory = dbScriptRunnerFactory;
              _dbVersionProvider = dbVersionProvider;
              _fileAdapter = fileAdapter;
              _zipFileAdapter = zipFileAdapter;
              _createScriptsToRunSelector = createScriptsToRunSelector;
              _databasePublisher = databasePublisher;
              _dbManagerFactory = dbManagerFactory;
              _userNameNormalizer = userNameNormalizer;
              _directoryAdapter = directoryAdapter;
        }
Ejemplo n.º 29
0
        public AgentService(
            IDeploymentPipeline deploymentPipeline,
            IProjectInfoRepository projectInfoRepository,
            IEnvironmentInfoRepository environmentInfoRepository,
            ITeamCityRestClient teamCityClient,
            IDeploymentRequestRepository deploymentRequestRepository,
            IDiagnosticMessagesLogger diagnosticMessagesLogger,
            IProjectMetadataExplorer projectMetadataExplorer,
            IDirPathParamsResolver dirPathParamsResolver,
            IApplicationConfiguration applicationConfiguration,
            IEnvironmentDeployInfoRepository environmentDeployInfoRepository,
            IEnvDeploymentPipeline envDeploymentPipeline)
        {
            Guard.NotNull(deploymentPipeline, "deploymentPipeline");
            Guard.NotNull(projectInfoRepository, "projectInfoRepository");
            Guard.NotNull(environmentInfoRepository, "environmentInfoRepository");
            Guard.NotNull(teamCityClient, "teamCityClient");
            Guard.NotNull(deploymentRequestRepository, "deploymentRequestRepository");
            Guard.NotNull(diagnosticMessagesLogger, "diagnosticMessagesLogger");
            Guard.NotNull(dirPathParamsResolver, "dirPathParamsResolver");
            Guard.NotNull(applicationConfiguration, "applicationConfiguration");
            Guard.NotNull(environmentDeployInfoRepository, "environmentDeployInfoRepository");
            Guard.NotNull(envDeploymentPipeline, "envDeploymentPipeline");

            _projectInfoRepository           = projectInfoRepository;
            _environmentInfoRepository       = environmentInfoRepository;
            _teamCityClient                  = teamCityClient;
            _deploymentPipeline              = deploymentPipeline;
            _deploymentRequestRepository     = deploymentRequestRepository;
            _diagnosticMessagesLogger        = diagnosticMessagesLogger;
            _projectMetadataExplorer         = projectMetadataExplorer;
            _dirPathParamsResolver           = dirPathParamsResolver;
            _applicationConfiguration        = applicationConfiguration;
            _environmentDeployInfoRepository = environmentDeployInfoRepository;
            _envDeploymentPipeline           = envDeploymentPipeline;
        }
        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;
        }
Ejemplo n.º 31
0
        public override int Run(string[] args)
        {
            if (args.Length != 1)
            {
                DisplayCommandUsage();

                return(1);
            }

            string projectName = args[0];

            IProjectInfoRepository projectInfoRepository =
                ObjectFactory.Instance.CreateProjectInfoRepository();

            ProjectInfo projectInfo = projectInfoRepository.FindByName(projectName);

            if (projectInfo == null)
            {
                OutputWriter.WriteLine("Project named '{0}' doesn't exist.", projectName);

                return(1);
            }

            ITeamCityClient teamCityClient =
                ObjectFactory.Instance.CreateTeamCityClient();

            Project        project        = teamCityClient.GetProjectByName(projectInfo.ArtifactsRepositoryName);
            ProjectDetails projectDetails = teamCityClient.GetProjectDetails(project);

            foreach (ProjectConfiguration projectConfiguration in projectDetails.ConfigurationsList.Configurations)
            {
                OutputWriter.WriteLine(projectConfiguration.Name);
            }

            return(0);
        }
Ejemplo n.º 32
0
 public DummyDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository)
     : base(projectInfoRepository, environmentInfoRepository)
 {
 }
 public DeployWebServiceDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IMsDeploy msDeploy, IArtifactsRepository artifactsRepository, IIisManager iisManager, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter, IApplicationConfiguration applicationConfiguration, IDirectoryAdapter directoryAdapter)
     : base(projectInfoRepository, environmentInfoRepository, msDeploy, artifactsRepository, iisManager, fileAdapter, zipFileAdapter, applicationConfiguration, directoryAdapter)
 {
 }
Ejemplo n.º 34
0
        public override int Run(string[] args)
        {
            if (args.Length != 4 && args.Length != 5)
            {
                DisplayCommandUsage();

                return(1);
            }

            IProjectInfoRepository projectInfoRepository =
                ObjectFactory.Instance.CreateProjectInfoRepository();

            string projectName = args[0];
            string projectConfigurationName    = args[1];
            string projectConfigurationBuildId = args[2];
            string targetEnvironmentName       = args[3];
            bool   isSimulation = (args.Length >= 5 ? string.Equals(args[4], "simulate", StringComparison.OrdinalIgnoreCase) : false);

            ProjectInfo projectInfo = projectInfoRepository.FindByName(projectName);

            if (projectInfo == null)
            {
                OutputWriter.WriteLine("Project named '{0}' doesn't exist.", projectName);
                return(1);
            }

            Guid deploymentId = Guid.NewGuid();

            var deploymentInfo =
                new DeploymentInfo(
                    deploymentId,
                    isSimulation,
                    projectName,
                    projectConfigurationName,
                    projectConfigurationBuildId,
                    targetEnvironmentName,
                    projectInfo.CreateEmptyInputParams());

            try
            {
                DeploymentTask deploymentTask =
                    projectInfo.CreateDeploymentTask(ObjectFactory.Instance);

                IDeploymentPipeline deploymentPipeline =
                    ObjectFactory.Instance.CreateDeploymentPipeline();

                deploymentPipeline.DiagnosticMessagePosted +=
                    (sender, tmpArgs) => LogMessage(tmpArgs.Message, tmpArgs.MessageType);

                var deploymentContext = new DeploymentContext(RequesterIdentity);

                deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext, false);

                return(0);
            }
            catch (Exception exc)
            {
                LogMessage("Error: " + exc, DiagnosticMessageType.Error);

                return(1);
            }
        }
Ejemplo n.º 35
0
 public ProjectInfoBusines(IProjectInfoRepository prjInfoRepository)
 {
     this.prjInfoRepository = prjInfoRepository;
 }
Ejemplo n.º 36
0
 public DeployWebServiceDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IMsDeploy msDeploy, IArtifactsRepository artifactsRepository, IIisManager iisManager, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter, IApplicationConfiguration applicationConfiguration, IDirectoryAdapter directoryAdapter)
     : base(projectInfoRepository, environmentInfoRepository, msDeploy, artifactsRepository, iisManager, fileAdapter, zipFileAdapter, applicationConfiguration, directoryAdapter)
 {
 }
Ejemplo n.º 37
0
 public ProjectsController(IProjectInfoRepository ProjectInfoRepository)
 {
     _ProjectInfoRepository = ProjectInfoRepository;
 }
 public DeployWebServiceDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, IMsDeploy msDeploy, IArtifactsRepository artifactsRepository, IIisManager iisManager, IFileAdapter fileAdapter, IZipFileAdapter zipFileAdapter)
     : base(projectInfoRepository, environmentInfoRepository, msDeploy, artifactsRepository, iisManager, fileAdapter, zipFileAdapter)
 {
 }
 public DummyDeploymentTask(IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository)
     : base(projectInfoRepository, environmentInfoRepository)
 {
 }
Ejemplo n.º 40
0
        public override int Run(string[] args)
        {
            if (args.Length != 3 && args.Length != 4)
            {
                DisplayCommandUsage();
                return(1);
            }

            IProjectInfoRepository projectInfoRepository =
                ObjectFactory.Instance.CreateProjectInfoRepository();

            string projectName = args[0];
            string projectConfigurationName = args[1];
            string targetEnvironmentName    = args[2];
            bool   isSimulation             = (args.Length >= 4 ? string.Equals(args[3], "simulate", StringComparison.OrdinalIgnoreCase) : false);

            ProjectInfo projectInfo = projectInfoRepository.FindByName(projectName);

            if (projectInfo == null)
            {
                OutputWriter.WriteLine("Project named '{0}' doesn't exist.", projectName);

                return(1);
            }

            ITeamCityClient teamCityClient =
                ObjectFactory.Instance.CreateTeamCityClient();

            Project        project        = teamCityClient.GetProjectByName(projectInfo.ArtifactsRepositoryName);
            ProjectDetails projectDetails = teamCityClient.GetProjectDetails(project);

            ProjectConfiguration projectConfiguration =
                projectDetails.ConfigurationsList
                .Configurations
                .SingleOrDefault(pc => pc.Name == projectConfigurationName);

            if (projectConfiguration == null)
            {
                OutputWriter.WriteLine(
                    "Project configuration named '{0}' doesn't exist for project '{1}'.",
                    projectConfigurationName,
                    projectName);

                return(0);
            }

            ProjectConfigurationDetails projectConfigurationDetails =
                teamCityClient.GetProjectConfigurationDetails(projectConfiguration);

            ProjectConfigurationBuild projectConfigurationBuild =
                teamCityClient.GetProjectConfigurationBuilds(projectConfigurationDetails, 0, 1)
                .Builds
                .FirstOrDefault();

            if (projectConfigurationBuild == null)
            {
                throw new InvalidOperationException(
                          string.Format(
                              "Project configuration '{0}' of project '{1}' doesn't have any builds yet.",
                              projectConfigurationName,
                              projectName));
            }

            if (projectConfigurationBuild.Status != BuildStatus.Success)
            {
                throw new InvalidOperationException(
                          string.Format(
                              "Couldn't deploy latest build of project configuration '{0}' of project '{1}' because it was not successfull.",
                              projectConfigurationName,
                              projectName));
            }

            string projectConfigurationBuildId = projectConfigurationBuild.Id;

            try
            {
                DeploymentTask deploymentTask =
                    projectInfo.CreateDeploymentTask(ObjectFactory.Instance);

                Guid deploymentId = Guid.NewGuid();

                var deploymentInfo =
                    new DeploymentInfo(
                        deploymentId,
                        isSimulation,
                        projectName,
                        projectConfigurationName,
                        projectConfigurationBuildId,
                        targetEnvironmentName,
                        projectInfo.CreateEmptyInputParams());

                IDeploymentPipeline deploymentPipeline =
                    ObjectFactory.Instance.CreateDeploymentPipeline();

                deploymentPipeline.DiagnosticMessagePosted +=
                    (eventSender, tmpArgs) => LogMessage(tmpArgs.Message, tmpArgs.MessageType);

                var deploymentContext = new DeploymentContext(RequesterIdentity);

                deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext, false);

                return(0);
            }
            catch (Exception exc)
            {
                LogMessage("Error: " + exc, DiagnosticMessageType.Error);

                return(1);
            }
        }
Ejemplo n.º 41
0
 public ProjectsController(IProjectInfoRepository ProjectInfoRepository,
                           IMapper mapper)
 {
     _ProjectInfoRepository = ProjectInfoRepository;
     _mapper = mapper;
 }