Exemple #1
0
 public AldoDeployer(IConfiguration configuration, IAzureService azureService, IDeploymentService deploymentService, INotificationService notificationService)
 {
     this.configuration       = configuration;
     this.azureService        = azureService;
     this.deploymentService   = deploymentService;
     this.notificationService = notificationService;
 }
 public DeploymentCommandProcessor(
     IDeploymentService service,
     IConsoleWriter writer)
 {
     _service = service;
     _writer  = writer;
 }
 public PackageInstallationService(InstallationTaskQueue pendingInstalls, 
     RunningInstallationTaskList runningInstalls, 
     CompletedInstallationTaskList completedInstalls,
     IDeploymentService deploymentService,
     ILogger logger,
     IHubCommunicator hubCommunicator, 
     ILocalPackageCache agentCache, 
     IInstalledPackageArchive installCache, 
     RunningInstallationTaskList runningTasks, 
     IAgentSettingsManager settingsManager,
     IPackagesList allPackagesList,
     CurrentlyDownloadingList currentlyDownloadingList,
     INotificationService notificationService)
 {
     CompletedInstalls = completedInstalls;
     _deploymentService = deploymentService;
     _logger = logger;
     _hubCommunicator = hubCommunicator;
     _agentCache = agentCache;
     _installCache = installCache;
     _runningTasks = runningTasks;
     _settingsManager = settingsManager;
     _allPackagesList = allPackagesList;
     _currentlyDownloadingList = currentlyDownloadingList;
     _notificationService = notificationService;
     PendingInstalls = pendingInstalls;
     RunningInstalls = runningInstalls;
     TimedTask = new TimedSingleExecutionTask(5000, CheckForNewInstallations, _logger);
 }
        private HttpClient GetTestClient(IDeploymentService deploymentService, IPipelineService pipelineService)
        {
            string unitTestFolder = Path.GetDirectoryName(new Uri(typeof(RepositoriesControllerTest).Assembly.Location).LocalPath);

            Program.ConfigureSetupLogging();
            HttpClient client = _factory.WithWebHostBuilder(builder =>
            {
                builder.ConfigureAppConfiguration((context, conf) =>
                {
                    conf.AddJsonFile("appsettings.json");
                });

                var configuration = new ConfigurationBuilder()
                                    .AddJsonFile("appsettings.json")
                                    .Build();

                builder.ConfigureTestServices(services =>
                {
                    services.AddSingleton <IGitea, IGiteaMock>();
                    services.AddSingleton(deploymentService);
                    services.AddSingleton(pipelineService);
                });
            }).CreateClient(new WebApplicationFactoryClientOptions {
                AllowAutoRedirect = false
            });

            return(client);
        }
Exemple #5
0
 public DeployActionHandler(
     IDeploymentService deploymentService,
     IDeploymentQueueService deploymentQueueService
     )
 {
     _deploymentService      = deploymentService;
     _deploymentQueueService = deploymentQueueService;
 }
Exemple #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="releaseService">IReleaseService</param>
 /// <param name="deploymentService">IDeploymentService</param>
 /// <param name="azureDevOpsBuildClient">IAzureDevOpsBuildClient</param>
 public PipelineService(
     IReleaseService releaseService,
     IDeploymentService deploymentService,
     IAzureDevOpsBuildClient azureDevOpsBuildClient)
 {
     _releaseService         = releaseService;
     _deploymentService      = deploymentService;
     _azureDevOpsBuildClient = azureDevOpsBuildClient;
 }
 public DeploymentJobsController(
     IDeploymentJobDataAccess jobsDataAccess,
     IDeploymentSettingsDataStore deploymentSettings,
     IDeploymentService deploymentService)
 {
     _jobsDataAccess     = jobsDataAccess;
     _deploymentSettings = deploymentSettings;
     _deploymentService  = deploymentService;
 }
 public DeployService()
 {
     InitializeComponent();
     const int IntervalSeconds = 10;
     _timer = new Timer(IntervalSeconds * 1000);
     _timer.Elapsed +=
         TimerElapsed;
     _deploymentService = Bootstrapper.Resolve<IDeploymentService>();
 }
Exemple #9
0
 public GitRepositorySyncJob(
     ILogger <GitRepositorySyncJob> log,
     IApplicationService applicationService,
     IDeploymentService deploymentService
     )
 {
     _log = log;
     _applicationService = applicationService;
     _deploymentService  = deploymentService;
 }
 public DeploymentsController(
     IDeploymentWorkflowService deploymentWorkflowService,
     IApplicationService applicationService,
     IDeploymentService deploymentService
     )
 {
     _deploymentWorkflowService = deploymentWorkflowService;
     _applicationService        = applicationService;
     _deploymentService         = deploymentService;
 }
 public DeployingContentHandler(
     IDeploymentService deploymentService,
     IOptions <OrchardDeploymentOptions> deploymentOptions,
     ILogger <DeployingContentHandler> logger
     )
 {
     _deploymentService = deploymentService;
     _deploymentOptions = deploymentOptions.Value;
     _logger            = logger;
 }
Exemple #12
0
 public DeploymentQueueController(
     IApplicationService applicationService,
     IDeploymentService deploymentService,
     IDeploymentQueueService deploymentQueueService
     )
 {
     _applicationService     = applicationService;
     _deploymentService      = deploymentService;
     _deploymentQueueService = deploymentQueueService;
 }
 public PackageInstallationService(InstallationTaskQueue pendingInstalls, 
     RunningInstallationTaskList runningInstalls, 
     CompletedInstallationTaskList completedInstalls,
     IDeploymentService deploymentService)
 {
     CompletedInstalls = completedInstalls;
     _deploymentService = deploymentService;
     PendingInstalls = pendingInstalls;
     RunningInstalls = runningInstalls;
     TimedTask = new TimedSingleExecutionTask(5000, CheckForNewInstallations);
 }
Exemple #14
0
        public void Deploy_Latest_Succeeds()
        {
            File.Copy(@"../../../testdata/solutiondeploy_tokens.json", "solutiondeploy_tokens.json", true);
            File.Copy(@"../../../testdata/manifest.json", "manifest.json", true);

            sut = BuildService();

            sut.Deploy("authorizationservice", "Azure Prod");

            File.Copy("solutiondeploy_tokens.json", @"../../../testdata/solutiondeploy_tokens.json", true);
        }
 //Set up constructor injection
 public DeploymentScheduleController(IServerService serverService, IEventLoggerService eventLoggerService, IDeploymentScheduleListService deploymentScheduleListService, IServerApplicationService serverApplicationService, IServerDeploymentStatusService serverDeploymentStatusService, IServerDetailService serverDetailService, IDeploymentService deploymentService, IDeploymentScheduleService deploymentScheduleService, IRnowService rnowService)
 {
     _serverService = serverService;
     _eventLoggerService = eventLoggerService;
     _deploymentScheduleListService = deploymentScheduleListService;
     _serverApplicationService = serverApplicationService;
     _serverDeploymentStatusService = serverDeploymentStatusService;
     _serverDetailService = serverDetailService;
     _deploymentService = deploymentService;
     _deploymentScheduleService = deploymentScheduleService;
     _rnowService = rnowService;
 }
Exemple #16
0
 public AbstractDeploymentController(
     ApiSettings settings,
     ILogger <AbstractDeploymentController> logger,
     ITransactionCoordinator transactionCoordinator,
     IDeploymentService deploymentService,
     IApiDeploymentModelMapper deploymentModelMapper
     )
     : base(settings, logger, transactionCoordinator)
 {
     this.DeploymentService     = deploymentService;
     this.DeploymentModelMapper = deploymentModelMapper;
 }
Exemple #17
0
 public DeploymentQueueService(
     IApplicationService applicationService,
     IDeploymentService deploymentService,
     IDeploymentNotificationService deploymentNotificationService,
     IEntityRepository <DeploymentQueue> deploymentQueueRepository
     )
 {
     _applicationService            = applicationService;
     _deploymentService             = deploymentService;
     _deploymentNotificationService = deploymentNotificationService;
     _deploymentQueueRepository     = deploymentQueueRepository;
 }
 public VercelLatestDeploymentTagHelper(
     IHtmlHelper html,
     IDeploymentService deploymentService,
     DeploymentStatusService deploymentStatusService,
     ILogger <VercelLatestDeploymentTagHelper> logger
     )
 {
     _html = html;
     _deploymentService       = deploymentService;
     _deploymentStatusService = deploymentStatusService;
     _logger = logger;
 }
Exemple #19
0
        public SecuredPagesModule(DataStore data, IApiService api, IDeploymentService deploy)
        {
            _Data   = data;
            _Api    = api;
            _Deploy = deploy;
            Before.AddItemToEndOfPipeline(CheckAuth);

            Get["/Sites"] = Sites;
            Put["/Sites/{slug}/Notifications/Email"] = EnableEmailNotification;
            Get["/Deploy/{key}"]  = Deploy;
            Post["/Deploy/{key}"] = DoDeploy;
        }
Exemple #20
0
 public RegistryWatcherJob(
     ILogger <RegistryWatcherJob> log,
     RegistryClientPool registryClientPool,
     IApplicationService applicationService,
     IDeploymentService deploymentService
     )
 {
     _log = log;
     _registryClientPool = registryClientPool;
     _applicationService = applicationService;
     _deploymentService  = deploymentService;
 }
        public SecuredPagesModule(DataStore data, IApiService api, IDeploymentService deploy)
        {
            _Data = data;
            _Api = api;
            _Deploy = deploy;
            Before.AddItemToEndOfPipeline(CheckAuth);

            Get["/Sites"] = Sites;
            Put["/Sites/{slug}/Notifications/Email"] = EnableEmailNotification;
            Get["/Deploy/{key}"] = Deploy;
            Post["/Deploy/{key}"] = DoDeploy;
        }
Exemple #22
0
        /// <summary>
        ///     The main entry point into the application.
        /// </summary>
        /// <param name="args">The arguments for this run</param>
        /// <exception cref="System.ArgumentException"></exception>
        private static void Main(string[] args)
        {
            try
            {
                ConfigurationService = Container.UnityContainer.Resolve <IConfigurationService>();
                DeploymentService    = Container.UnityContainer.Resolve <IDeploymentService>();

                ConfigurationService.ConnectionString = GetSetting <string>("ConnectionString");

                switch (GetSetting <string>("DatabaseType"))
                {
                case "mssql":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.SqlServer;
                    break;

                case "ora":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.Oracle;
                    break;

                case "mysql":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.MySql;
                    break;

                default:
                    string message =
                        string.Format(
                            "An invalid database type of {0} was specified.  Only \"mssql\", \"ora\", and \"mysql\" are supported.",
                            GetSetting <string>("DatabaseType"));
                    Log.Fatal(message);
                    throw new ArgumentException(message);
                }

                ConfigurationService.LastChangeToApply = GetSetting <int>("LastChangeToApply");
                ConfigurationService.OutputFile        = GetSetting <string>("OutputFile");
                ConfigurationService.Recursive         = GetSetting <bool>("Recursive");
                ConfigurationService.RootDirectory     = GetSetting <string>("RootDirectory");
                ConfigurationService.SearchPattern     = GetSetting <string>("SearchPattern");
                ConfigurationService.FileNamePattern   = GetSetting <string>("FileNamePattern");
                ConfigurationService.UndoOutputFile    = GetSetting <string>("UndoFile");
                ConfigurationService.Schema            = GetSetting <string>("Schema");
                ConfigurationService.ChangeLog         = GetSetting <string>("ChangeLog");

                ParseCommandLine(args);

                DeploymentService.BuildDeploymentScript();
            }
            catch (Exception ex)
            {
                Log.Error(ex);
            }
        }
 public VercelDeploymentsController(
     IAuthorizationService authorizationService,
     IDeploymentService deploymentService,
     DeploymentStatusService deploymentStatusService,
     DeploymentStatus serviceState,
     ILogger <VercelDeploymentsController> logger
     )
 {
     _authorizationService    = authorizationService;
     _deploymentService       = deploymentService;
     _deploymentStatusService = deploymentStatusService;
     _serviceState            = serviceState;
     _logger = logger;
 }
Exemple #24
0
        /// <summary>
        /// The main entry point into the application.
        /// </summary>
        /// <param name="args">
        /// The arguments for this run
        /// </param>
        private static void Main(string[] args)
        {
            if (log.IsDebugEnabled)
            {
                log.Debug(LogUtility.GetContext(args));
            }

            try
            {
                Container.UnityContainer.RegisterType <IConfigurationService>(new PerThreadLifetimeManager());

                ConfigurationService = Container.UnityContainer.Resolve <IConfigurationService>();
                DeploymentService    = Container.UnityContainer.Resolve <IDeploymentService>();

                ConfigurationService.ConnectionString = GetSetting <string>("ConnectionString");

                switch (GetSetting <string>("DatabaseType"))
                {
                case "mssql":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.SqlServer;
                    break;

                case "ora":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.Oracle;
                    break;

                case "mysql":
                    ConfigurationService.DatabaseManagementSystem = DatabaseTypesEnum.MySql;
                    break;

                default:
                    string message = string.Format("An invalid database type of {0} was specified.  Only \"mssql\", \"ora\", and \"mysql\" are supported (and only mssql will work at this time).", GetSetting <string>("DatabaseType"));
                    log.Fatal(message);
                    throw new ArgumentException(message);
                }

                ConfigurationService.LastChangeToApply = GetSetting <int>("LastChangeToApply");
                ConfigurationService.OutputFile        = GetSetting <string>("OutputFile");
                ConfigurationService.Recursive         = GetSetting <bool>("Recursive");
                ConfigurationService.RootDirectory     = GetSetting <string>("RootDirectory");
                ConfigurationService.SearchPattern     = GetSetting <string>("SearchPattern");
                ConfigurationService.UndoOutputFile    = GetSetting <string>("UndoFile");

                DeploymentService.BuildDeploymentScript();
            }
            catch (Exception ex)
            {
                log.Error(ex);
            }
        }
 public void BeforeEach()
 {
     environmentRepositoryMock =
         new Mock<IEnvironmentRepository>();
     pipelineRepositoryMock =
         new Mock<IPipelineRepository>();
     deploymentUtilityMock =
         new Mock<IDeploymentUtility>();
     deploymentRepository = new FakeDeploymentRepository();
     deploymentService = new DeploymentService(
         environmentRepositoryMock.Object,
         pipelineRepositoryMock.Object,
         deploymentRepository,
         deploymentUtilityMock.Object);
 }
Exemple #26
0
        // private readonly IKubernetes _kubernetes;

        public DiagnosticsController(
            ILogger <DiagnosticsController> log,
            IDeploymentService deploymentService,
            IDeploymentNotificationService deploymentNotificationService,
            ISlackClient slackClient,
            IContainerImageMetadataService containerImageMetadataService,
            IGitHubClient gitHubClient
            )
        {
            _log = log;
            _deploymentService             = deploymentService;
            _deploymentNotificationService = deploymentNotificationService;
            _slackClient = slackClient;
            _containerImageMetadataService = containerImageMetadataService;
            _gitHubClient = gitHubClient;
        }
Exemple #27
0
        public void ThatAutoResolverGivesSameInstanceWithPerThreadMapping()
        {
            Container.Reset();

            Container.UnityContainer.RegisterType <IConfigurationService>(new PerThreadLifetimeManager());

            IConfigurationService service = Container.UnityContainer.Resolve <IConfigurationService>();

            service.ConnectionString = "A fake connection string.";

            IDeploymentService deployment = Container.UnityContainer.Resolve <IDeploymentService>();

            Assert.That(service, Is.EqualTo(deployment.ConfigurationService));

            Container.Reset();
        }
Exemple #28
0
 public DeploymentController(
     ApiSettings settings,
     ILogger <DeploymentController> logger,
     ITransactionCoordinator transactionCoordinator,
     IDeploymentService deploymentService,
     IApiDeploymentModelMapper deploymentModelMapper
     )
     : base(settings,
            logger,
            transactionCoordinator,
            deploymentService,
            deploymentModelMapper)
 {
     this.BulkInsertLimit = 250;
     this.MaxLimit        = 1000;
     this.DefaultLimit    = 250;
 }
Exemple #29
0
 public DeploymentWorkflowService(
     ILogger <DeploymentWorkflowService> log,
     IContainerImageMetadataService containerImageMetadataService,
     IApplicationService applicationService,
     IApplicationImageInstanceService applicationImageInstanceService,
     IDeploymentService deploymentService,
     IDeploymentQueueService deploymentQueueService,
     IGitHubClient gitHubClient
     )
 {
     _log = log;
     _containerImageMetadataService   = containerImageMetadataService;
     _applicationService              = applicationService;
     _applicationImageInstanceService = applicationImageInstanceService;
     _deploymentService      = deploymentService;
     _deploymentQueueService = deploymentQueueService;
     _gitHubClient           = gitHubClient;
 }
Exemple #30
0
 public SlackIntegrationController(
     ILogger <SlackIntegrationController> log,
     ISlackEventDispatcher slackEventDispatcher,
     ISlackShortcutInteractionDispatcher slackShortcutInteractionDispatcher,
     ISlackInteractionActionDispatcher slackInteractionActionDispatcher,
     IDeploymentService deploymentService,
     IDeploymentQueueService deploymentQueueService,
     ISlackApiClient slackApiClient,
     ISlackExternalOptionsProvider externalOptionsProvider
     )
 {
     _log = log;
     _slackEventDispatcher = slackEventDispatcher;
     _slackShortcutInteractionDispatcher = slackShortcutInteractionDispatcher;
     _slackInteractionActionDispatcher   = slackInteractionActionDispatcher;
     _deploymentService       = deploymentService;
     _deploymentQueueService  = deploymentQueueService;
     _slackApiClient          = slackApiClient;
     _externalOptionsProvider = externalOptionsProvider;
 }
Exemple #31
0
        public async Task <IActionResult> CheckDeploymentStatus(
            AzureDevOpsWebHookEventModel model,
            [FromServices] IDeploymentService deploymentService)
        {
            string buildId = model.Resource.BuildNumber;
            Build  build   = await _buildClient.Get(buildId);

            await deploymentService.UpdateAsync(new DeploymentEntity
            {
                Build = new BuildEntity
                {
                    Id       = build.Id.ToString(),
                    Result   = build.Result,
                    Status   = build.Status,
                    Started  = build.StartTime,
                    Finished = build.FinishTime
                }
            });

            return(Ok());
        }
 public DeploymentModule(
     IExceptionHandler exceptionHandler,
     IApplicationSettings applicationSettings,
     ISystemClock systemClock,
     IConsoleWrapper <DeploymentModule> consoleWrapper,
     ITargetService targetService,
     IDeploymentService deploymentService)
     : base(exceptionHandler)
 {
     ActionDictionary
     .Add(builder => builder.Add("add", AddDeployment)
          .Add("list", ListDeployments));
     DefaultAction            = GetDeployment;
     RequiresArguments        = true;
     WriteLineAsyncAction     = (format, args, logLevel) => consoleWrapper.WriteLineAsync(format, true, logLevel, args);
     this.applicationSettings = applicationSettings;
     this.systemClock         = systemClock;
     this.consoleWrapper      = consoleWrapper;
     this.targetService       = targetService;
     this.deploymentService   = deploymentService;
 }
Exemple #33
0
 public GitRepositorySyncJob(
     ILogger <GitRepositorySyncJob> log,
     IApplicationService applicationService,
     IDeploymentService deploymentService,
     IDeploymentQueueService deploymentQueueService,
     IOptions <ShipbotConfiguration> configuration,
     IApplicationImageInstanceService applicationImageInstanceService,
     IDeploymentManifestSourceManagementFacade deploymentManifestSourceManagementFacade,
     IDeploymentManifestRepositoryService deploymentManifestRepositoryService,
     IGithubPullRequestService githubPullRequestService
     )
 {
     _log = log;
     _applicationService                       = applicationService;
     _deploymentService                        = deploymentService;
     _deploymentQueueService                   = deploymentQueueService;
     _configuration                            = configuration;
     _applicationImageInstanceService          = applicationImageInstanceService;
     _deploymentManifestSourceManagementFacade = deploymentManifestSourceManagementFacade;
     _deploymentManifestRepositoryService      = deploymentManifestRepositoryService;
     _githubPullRequestService                 = githubPullRequestService;
 }
        public void Init()
        {
            _disposed = false;

            _repositoryManagerMock = new Mock <IDistributedRevControlRepositoryManager>();
            _repositoryManagerMock.Setup(rm => rm.State).Returns(RepositoryState.Closed);
            _repositoryManagerMock.Setup(rm => rm.AllBranches).Returns(new List <BranchEntity>()
            {
                new BranchEntity()
                {
                    Name = "Live", IsRemote = false, IsCurrentHead = true
                }, new BranchEntity()
                {
                    Name = "Live", IsRemote = true, IsCurrentHead = false
                }
            });
            _repositoryManagerMock.Setup(rm => rm.AllLocalBranches).Returns(_repositoryManagerMock.Object.AllBranches.ToList().Where(b => !b.IsRemote));
            _repositoryManagerMock.Setup(rm => rm.AllRemoteBranches).Returns(_repositoryManagerMock.Object.AllBranches.ToList().Where(b => b.IsRemote));
            _repositoryManagerMock.Setup(rm => rm.ReadConfigurationFromFile(It.IsAny <string>())).Returns(GetMockConfiguration());
            _repositoryManagerMock.Setup(rm => rm.OpenRepository(It.IsAny <string>())).Callback(() => _repositoryManagerMock.Setup(rm => rm.State).Returns(RepositoryState.Opened));
            _repositoryManagerMock.Setup(rm => rm.CloseRepository()).Callback(() => _repositoryManagerMock.Setup(rm => rm.State).Returns(RepositoryState.Closed));
            _repositoryManagerMock.Setup(rm => rm.DownloadReferencesFromRemote(It.IsAny <string>())).Callback(() => _repositoryManagerMock.Setup(rm => rm.BranchesWithNewReferences).Returns(new List <string>()
            {
                DeploymentBranchName
            }));

            _projectBuilderMock = new Mock <IProjectBuilder>();
            _projectBuilderMock.Setup(pb => pb.LoadSolutionFile(It.IsAny <string>())).Returns(true).Callback((string s) => _projectBuilderMock.Setup(pb => pb.CurrentlyLoadedSolutionFile).Returns(s));
            _projectBuilderMock.Setup(pb => pb.BuildSolution(It.IsAny <string>())).Returns(true);

            _deploymentManagerMock = new Mock <IDeploymentManager>();
            _deploymentManagerMock.Setup(dm => dm.ExecuteDeploymentAction(It.IsAny <DeploymentActionType>(), It.IsAny <string[]>())).Returns(true);

            // TODO: setup exception manager mock.
            _exceptionManagerMock = new Mock <IExceptionManager>();

            _deploymentService = new DeploymentService(ConfigurationFileName, false, _repositoryManagerMock.Object, _projectBuilderMock.Object, _deploymentManagerMock.Object, _exceptionManagerMock.Object);
        }
 public InstallationManager(IDeploymentService deploymentService, ILogger logger)
 {
     _deploymentService = deploymentService;
     _logger = logger;
     _progressReportAction = ReportProgress;
 }
 public HomeController()
 {
     _environmentRepository = Bootstrapper.Resolve<IEnvironmentRepository>();
     _deploymentService = Bootstrapper.Resolve<IDeploymentService>();
     _pipelineRepository = Bootstrapper.Resolve<IPipelineRepository>();
 }
Exemple #37
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="deploymentService">IDeploymentService</param>
 public DeploymentsController(IDeploymentService deploymentService)
 {
     _deploymentService = deploymentService;
 }
Exemple #38
0
 public InstallationManager(IDeploymentService deploymentService)
 {
     _deploymentService = deploymentService;
     _progressReportAction = ReportProgress;
 }
Exemple #39
0
 public EntityFrameworkTenantPersistenceService(IDeploymentService deploymentService)
 {
     DeploymentService = deploymentService;
 }