public DeploymentController(IApplicationRepository applicationRepository, IDeploymentRepository deploymentRepository, IApplicationHashingService applicationHashingService, IAuditRepository auditRepository) { this.applicationRepository = applicationRepository; this.deploymentRepository = deploymentRepository; this.applicationHashingService = applicationHashingService; this.auditRepository = auditRepository; }
public DeploymentManagerController(IIndexViewModelBuilder indexViewModelBuilder, IModifyViewModelBuilder modifyViewModelBuilder, IProcessInputModelService processInputModelService, IDeploymentRepository deploymentRepository, IInstanceToWidgetInputModelMapper instanceToWidgetInputModelMapper, IGuidGetter guidGetter, ITextTemplateZipProcessor textTemplateZipProcessor, ITextTemplateBatchContext textTemplateBatchContext, IGetWorkingFolderPath getWorkingFolderPath, IFileSystem fileSystem, IT4StateContext t4StateContext, DeployToBranchService deployToBranchService) { this.deployToBranchService = deployToBranchService; this.t4StateContext = t4StateContext; this.fileSystem = fileSystem; this.getWorkingFolderPath = getWorkingFolderPath; this.textTemplateBatchContext = textTemplateBatchContext; this.textTemplateZipProcessor = textTemplateZipProcessor; this.guidGetter = guidGetter; this.instanceToWidgetInputModelMapper = instanceToWidgetInputModelMapper; this.deploymentRepository = deploymentRepository; this.processInputModelService = processInputModelService; this.modifyViewModelBuilder = modifyViewModelBuilder; this.indexViewModelBuilder = indexViewModelBuilder; }
public ProcessInputModelService(IInputModelToWidgetMapper inputModelToWidgetMapper, IDeploymentRepository deploymentRepository, IGetCurrentDateTime getCurrentDateTime) { this.getCurrentDateTime = getCurrentDateTime; this.deploymentRepository = deploymentRepository; this.inputModelToWidgetMapper = inputModelToWidgetMapper; }
public EnvironmentController( IDeploymentRepository deploymentRepository, IEnvironmentRepository environmentRepository, IPipelineRepository pipelineRepository) { _deploymentRepository = deploymentRepository; _environmentRepository = environmentRepository; _pipelineRepository = pipelineRepository; }
public DeploymentService( IEnvironmentRepository environmentRepository, IPipelineRepository pipelineRepository, IDeploymentRepository deploymentRepository, IDeploymentUtility deploymentUtility) { this.deploymentRepository = deploymentRepository; this.environmentRepository = environmentRepository; this.pipelineRepository = pipelineRepository; this.deploymentUtility = deploymentUtility; }
public static IYamsService Create(YamsConfig yamsConfig, string deploymentRepositoryStorageConnectionString, string updateSessionStorageConnectionString) { IUpdateSessionManager updateSessionManager = new AzureBlobStorageUpdateSessionDiModule( yamsConfig.ClusterId, yamsConfig.InstanceId, yamsConfig.InstanceUpdateDomain, updateSessionStorageConnectionString).UpdateSessionManager; IDeploymentRepository deploymentRepository = BlobStorageDeploymentRepository.Create(deploymentRepositoryStorageConnectionString); return(new YamsDiModule(yamsConfig, deploymentRepository, updateSessionManager).YamsService); }
private async void OnPublishToBlob(object sender, RoutedEventArgs e) { BusyWindow busyWindow = new BusyWindow { Message = "Please wait..\n\n" + "The DeploymentConfig.json file is being uploaded to blob storage" }; busyWindow.Show(); StorageAccountConnectionInfo connectionInfo = GetCurrentConnection(); IDeploymentRepository connection = _deploymentRepositoryManager.GetRepository(connectionInfo); await connection.PublishDeploymentConfig(_deploymentConfig); busyWindow.Close(); }
private async Task <DeploymentConfig> FetchDeploymentConfig(StorageAccountConnectionInfo connectionInfo) { string path = GetDeploymentConfigLocalPath(connectionInfo.AccountName); if (File.Exists(path)) { return(new DeploymentConfig(File.ReadAllText(path))); } IDeploymentRepository connection = _deploymentRepositoryManager.GetRepository(connectionInfo); DeploymentConfig deploymentConfig = await connection.FetchDeploymentConfig(); SaveLocalDeploymentConfig(connectionInfo, deploymentConfig.RawData()); return(deploymentConfig); }
public DeploymentController( ILogger <DeploymentController> logger, IDeploymentRepository deploymentRepository, ICalendarRepository calendarRepository, ICompanyRepository companyRepository, IVehicleRepository vehicleRepository ) { Logger = logger; DeploymentRepository = deploymentRepository; CalendarRepository = calendarRepository; CompanyRepository = companyRepository; VehicleRepository = vehicleRepository; }
private async void OnSyncFromBlob(object sender, RoutedEventArgs e) { MessageBoxResult res = MessageBox.Show("This will ovewrite any local changes\n\n Are you sure you want to continue?", "Sync From Blob", MessageBoxButton.YesNo); if (res == MessageBoxResult.Yes) { StorageAccountConnectionInfo connectionInfo = GetCurrentConnection(); IDeploymentRepository connection = _deploymentRepositoryManager.GetRepository(connectionInfo); DeploymentConfig deploymentConfig = await connection.FetchDeploymentConfig(); SaveLocalDeploymentConfig(connectionInfo, deploymentConfig.RawData()); } }
internal MLOpsContext(IModelRepository modelRepository, IExperimentRepository experimentRepository, IRunRepository runRepository, IDataRepository dataRepository, IMetricRepository metricRepository, IConfusionMatrixRepository confusionMatrixRepository, IHyperParameterRepository hyperParameterRepository, IDeploymentRepository deploymentRepository) { if (modelRepository == null) { throw new ArgumentNullException(nameof(modelRepository)); } if (experimentRepository == null) { throw new ArgumentNullException(nameof(experimentRepository)); } if (runRepository == null) { throw new ArgumentNullException(nameof(runRepository)); } if (dataRepository == null) { throw new ArgumentNullException(nameof(dataRepository)); } if (metricRepository == null) { throw new ArgumentNullException(nameof(metricRepository)); } if (confusionMatrixRepository == null) { throw new ArgumentNullException(nameof(confusionMatrixRepository)); } if (hyperParameterRepository == null) { throw new ArgumentNullException(nameof(hyperParameterRepository)); } if (deploymentRepository == null) { throw new ArgumentNullException(nameof(deploymentRepository)); } this.LifeCycle = new LifeCycleCatalog(experimentRepository, runRepository, new Clock()); this.Data = new DataCatalog(dataRepository); this.Evaluation = new EvaluationCatalog(metricRepository, confusionMatrixRepository); this.Model = new ModelCatalog(modelRepository, runRepository); this.Training = new TrainingCatalog(hyperParameterRepository); this.Deployment = new DeploymentCatalog(deploymentRepository, modelRepository, experimentRepository); }
private async Task AddApplication(AppIdentity appIdentity, string deploymentId, string binariesPath) { StorageAccountConnectionInfo connectionInfo = GetCurrentConnection(); IDeploymentRepository repository = _deploymentRepositoryManager.GetRepository(connectionInfo); BusyWindow busyWindow = new BusyWindow { Message = "Please wait..\n\n" + "The binaries are being uploaded to blob storage" }; busyWindow.Show(); await repository.UploadApplicationBinaries(appIdentity, binariesPath, ConflictResolutionMode.DoNothingIfBinariesExist); busyWindow.Close(); _deploymentConfig = _deploymentConfig.AddApplication(appIdentity, deploymentId); SaveLocalDeploymentConfig(connectionInfo); }
public DatabaseMigrator(DeploymentSettings deploymentSettings, IConnectionFactory connectionFactory) { this.deploymentSettings = deploymentSettings; this.connectionFactory = connectionFactory; // Instantiate everything else this.keepWorkingDirectory = false; roundHouseManager = new RoundhouseManager(); fileService = new RoundHouseFileService(); availabilityGroupRepository = new AvailabilityGroupRepository(connectionFactory); deploymentRepo = new DeploymentRepository(connectionFactory); sqlScriptTokenService = new SqlScriptTokenService(new SqlScriptTokenValueProvider(deploymentRepo, this.deploymentSettings.Server)); this.configurationRepository = new ConfigurationRepository(connectionFactory); this.timeService = new TimeService(); }
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); }
public DeploymentManager(IDeploymentRepository serverRepository, ISiteBuilderFactory builderFactory, IEnvironment environment, IFileSystem fileSystem, ITraceFactory traceFactory, IOperationLock deploymentLock, ILogger globalLogger) { _serverRepository = serverRepository; _builderFactory = builderFactory; _environment = environment; _fileSystem = fileSystem; _traceFactory = traceFactory; _deploymentLock = deploymentLock; _globalLogger = globalLogger ?? NullLogger.Instance; }
public AuditManager(IApplicationHashingService hashingService, IAuditRepository auditRepository, IDeploymentRepository deploymentRepository, IApplicationRepository applicationRepository, IMailService mailService) { this.hashingService = hashingService ?? DIContainer.Container.GetInstance<IApplicationHashingService>(); this.auditRepository = auditRepository ?? DIContainer.Container.GetInstance<IAuditRepository>(); this.deploymentRepository = deploymentRepository ?? DIContainer.Container.GetInstance<IDeploymentRepository>(); this.applicationRepository = applicationRepository ?? DIContainer.Container.GetInstance<IApplicationRepository>(); this.mailService = mailService ?? DIContainer.Container.GetInstance<IMailService>(); var seconds = Configuration.AuditTimerInSeconds; if (seconds > 59) { timer = new Timer(seconds * 1000); timer.Elapsed += Timer_Elapsed; } }
public AuditManager(IApplicationHashingService hashingService, IAuditRepository auditRepository, IDeploymentRepository deploymentRepository, IApplicationRepository applicationRepository, IMailService mailService) { this.hashingService = hashingService ?? DIContainer.Container.GetInstance <IApplicationHashingService>(); this.auditRepository = auditRepository ?? DIContainer.Container.GetInstance <IAuditRepository>(); this.deploymentRepository = deploymentRepository ?? DIContainer.Container.GetInstance <IDeploymentRepository>(); this.applicationRepository = applicationRepository ?? DIContainer.Container.GetInstance <IApplicationRepository>(); this.mailService = mailService ?? DIContainer.Container.GetInstance <IMailService>(); var seconds = Configuration.AuditTimerInSeconds; if (seconds > 59) { timer = new Timer(seconds * 1000); timer.Elapsed += Timer_Elapsed; } }
/// <summary> /// Constructor /// </summary> public DeploymentService( IOptionsMonitor <AzureDevOpsSettings> azureDevOpsOptions, IAzureDevOpsBuildClient azureDevOpsBuildClient, IHttpContextAccessor httpContextAccessor, IDeploymentRepository deploymentRepository, IReleaseRepository releaseRepository, IApplicationInformationService applicationInformationService) { _azureDevOpsBuildClient = azureDevOpsBuildClient; _deploymentRepository = deploymentRepository; _releaseRepository = releaseRepository; _applicationInformationService = applicationInformationService; _azureDevOpsSettings = azureDevOpsOptions.CurrentValue; _httpContext = httpContextAccessor.HttpContext; _org = _httpContext.GetRouteValue("org")?.ToString(); _app = _httpContext.GetRouteValue("app")?.ToString(); }
public static ContainerBuilder RegisterTypes(YamsConfig config, IDeploymentRepository deploymentRepository, IDeploymentStatusWriter deploymentStatusWriter, IUpdateSessionManager updateSessionManager) { var builder = new ContainerBuilder(); RegisterConfig(builder, config); RegisterProcessFactory(builder); RegisterProcessStopper(builder); RegisterApplicationConfigSymbolResolver(builder); RegisterApplicationConfigParser(builder); RegisterConfigurableApplicationFactory(builder); RegisterApplicationDeploymentDirectory(builder); RegisterApplicationPool(builder); RegisterApplicationInstaller(builder); RegisterApplicationDownloader(builder); RegisterApplicationUpdateManager(builder); RegisterDeploymentWatcher(builder); builder.RegisterInstance(updateSessionManager); builder.RegisterInstance(deploymentRepository); builder.RegisterInstance(deploymentStatusWriter); builder.RegisterType <YamsService>().As <IYamsService>().SingleInstance(); RegisterAppDeploymentMatcher(builder); builder.RegisterType <DiagnosticsTraceWriter>().As <ITraceWriter>().SingleInstance(); builder.RegisterType <JsonSerializer>().As <IJsonSerializer>().SingleInstance(); builder.RegisterType <Os.System>().As <ISystem>().SingleInstance(); return(builder); }
public DeploymentService( ILogger <IDeploymentRepository> logger, IDeploymentRepository deploymentRepository, IApiDeploymentRequestModelValidator deploymentModelValidator, IBOLDeploymentMapper boldeploymentMapper, IDALDeploymentMapper daldeploymentMapper, IBOLDeploymentRelatedMachineMapper bolDeploymentRelatedMachineMapper, IDALDeploymentRelatedMachineMapper dalDeploymentRelatedMachineMapper ) : base(logger, deploymentRepository, deploymentModelValidator, boldeploymentMapper, daldeploymentMapper, bolDeploymentRelatedMachineMapper, dalDeploymentRelatedMachineMapper) { }
public AbstractDeploymentService( ILogger logger, IDeploymentRepository deploymentRepository, IApiDeploymentRequestModelValidator deploymentModelValidator, IBOLDeploymentMapper bolDeploymentMapper, IDALDeploymentMapper dalDeploymentMapper, IBOLDeploymentRelatedMachineMapper bolDeploymentRelatedMachineMapper, IDALDeploymentRelatedMachineMapper dalDeploymentRelatedMachineMapper) : base() { this.deploymentRepository = deploymentRepository; this.deploymentModelValidator = deploymentModelValidator; this.bolDeploymentMapper = bolDeploymentMapper; this.dalDeploymentMapper = dalDeploymentMapper; this.bolDeploymentRelatedMachineMapper = bolDeploymentRelatedMachineMapper; this.dalDeploymentRelatedMachineMapper = dalDeploymentRelatedMachineMapper; this.logger = logger; }
public DatabaseMigrator( DeploymentSettings deploymentSettings, IConnectionFactory connectionFactory, ISqlScriptTokenService sqlScriptTokenService, IRoundhouseManager roundhouseManager, IDeploymentRepository deploymentRepo, IAvailabilityGroupRepository availabilityGroupRepository, IRoundHouseFileService roundHouseFileService, ITimeService timeService) { this.deploymentSettings = deploymentSettings; this.connectionFactory = connectionFactory; this.fileService = roundHouseFileService; this.sqlScriptTokenService = sqlScriptTokenService; this.roundHouseManager = roundhouseManager; this.deploymentRepo = deploymentRepo; this.availabilityGroupRepository = availabilityGroupRepository; this.timeService = timeService; }
public static ContainerBuilder RegisterTypes(YamsConfig config, IDeploymentRepository deploymentRepository, IUpdateSessionManager updateSessionManager) { var builder = new ContainerBuilder(); RegisterConfig(builder, config); RegisterProcessFactory(builder); RegisterProcessStopper(builder); RegisterApplicationConfigSymbolResolver(builder); RegisterApplicationConfigParser(builder); RegisterConfigurableApplicationFactory(builder); RegisterApplicationDeploymentDirectory(builder); RegisterApplicationPool(builder); RegisterApplicationInstaller(builder); RegisterApplicationDownloader(builder); RegisterApplicationUpdateManager(builder); RegisterDeploymentWatcher(builder); builder.RegisterInstance(updateSessionManager); builder.RegisterInstance(deploymentRepository); builder.RegisterType<YamsService>().As<IYamsService>().SingleInstance(); RegisterAppDeploymentMatcher(builder); builder.RegisterType<DiagnosticsTraceWriter>().As<ITraceWriter>().SingleInstance(); builder.RegisterType<JsonSerializer>().As<IJsonSerializer>().SingleInstance(); return builder; }
private void populateDeploymentGrid(IDeploymentRepository repository) { var rowFactory = ObjectFactory.GetInstance<IDeploymentRowFactory>(); grdDeployments.Rows.Clear(); var deployments = repository.Find(SelectedApplication.Name, SelectedEnvironment.Name); var rowNumber = 0; foreach (var deployment in deployments) { string[] deploymentRow = rowFactory.ConstructRow(deployment); grdDeployments.Rows.Add(deploymentRow); if (deployment.Result == DeploymentResult.Failure) { grdDeployments.Rows[rowNumber].DefaultCellStyle.BackColor = Color.Pink; } rowNumber++; } }
private void populateDeploymentGrid(IDeploymentRepository repository) { var rowFactory = ObjectFactory.GetInstance <IDeploymentRowFactory>(); grdDeployments.Rows.Clear(); var deployments = repository.Find(SelectedApplication.Name, SelectedEnvironment.Name); var rowNumber = 0; foreach (var deployment in deployments) { string[] deploymentRow = rowFactory.ConstructRow(deployment); grdDeployments.Rows.Add(deploymentRow); if (deployment.Result == DeploymentResult.Failure) { grdDeployments.Rows[rowNumber].DefaultCellStyle.BackColor = Color.Pink; } rowNumber++; } }
/// <summary> /// Creates the instance of the provider. /// </summary> /// <returns>Provider instance.</returns> public static IDeploymentRepository CreateInstance() { string assemblyName; string typeName; // Extract the assembly name and type name from the configuration setting. GetTypeInfo(Settings.Default.DeploymentRepositoryProvider, out assemblyName, out typeName); if (string.IsNullOrEmpty(assemblyName) || string.IsNullOrEmpty(typeName)) { throw new ConfigurationErrorsException("Invalid type information in the configuration for provider."); } // Dynamically load the assembly using normal resolution. Assembly assem = Assembly.Load(assemblyName); if (assem == null) { throw new ConfigurationErrorsException(String.Format("Could not load assembly {0}.", assemblyName)); } // Dynamic instance creation. IDeploymentRepository instance = assem.CreateInstance(typeName) as IDeploymentRepository; return(instance); }
public DeploymentsController() { var config = Settings.StorageConfiguration; this.repository = new DeploymentRepository(config); }
public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository, IUpdateSessionManager updateSessionManager) { _container = RegisterTypes(config, deploymentRepository, updateSessionManager).Build(); }
public DeploymentRepositoryTests(DatabaseFixture fixture) { Repository = new DeploymentRepository(fixture.Context); }
public RemoteService(IServerRepository serverRepository, IDeploymentRepository deploymentRepository) { _deploymentRepository = deploymentRepository; _remoteFolderCache = new Dictionary <string, IRemoteFolder>(StringComparer.OrdinalIgnoreCase); _serverRepository = serverRepository; }
public IndexViewModelBuilder(IDeploymentRepository deploymentRepository) { this.deploymentRepository = deploymentRepository; }
public RemoteApplicationDeploymentDirectory(IDeploymentRepository deploymentRepository) { _deploymentRepository = deploymentRepository; }
public PerfCountersController() { var config = Settings.StorageConfiguration; this.repository = new PerfCounterRepository(config); this.deployments = new DeploymentRepository(config); }
public IndexModule(IGithubUserRepository githubUserRepository, IDeploymentRepository deploymentRepository, IRootPathProvider rootPathProvider) { this.githubUserRepository = githubUserRepository; this.rootPathProvider = rootPathProvider; this.snowPreCompilerPath = rootPathProvider.GetRootPath() + "PreCompiler\\Sandra.Snow.Precompiler.exe"; Post["/"] = parameters => { var payloadModel = this.Bind<GithubHookModel.RootObject>(); //Check if user is registered var githubhookfromUsername = payloadModel.repository.owner.name; var githubhookfromRepo = payloadModel.repository.url; if (!githubUserRepository.UserRegistered(githubhookfromUsername, githubhookfromRepo)) return HttpStatusCode.Forbidden; var deploymentModel = deploymentRepository.GetDeployment(githubhookfromUsername); DeployBlog(deploymentModel); return 200; }; Get["/"] = parameters => { return View["Index"]; }; Get["/repos"] = parameters => { return View["Repos"]; }; Get["getrepodata/{githubuser}"] = parameters => { var githubUser = (string)parameters.githubuser; var client = new RestClient("https://api.github.com"); var request = new RestRequest("users/" + githubUser + "/repos"); request.AddHeader("Accept", "application/json"); var response = client.Execute<List<GithubUserRepos.RootObject>>(request); var repoDetail = response.Data //.Where(x => x.fork == false) .Select( x => new RepoDetail { Name = x.name, AvatarUrl = x.owner.avatar_url, Description = x.description, HtmlUrl = x.html_url, UpdatedAt = DateTime.Parse(x.pushed_at).ToRelativeTime(), CloneUrl = x.clone_url }); var viewModel = new RepoModel { Username = githubUser, Repos = repoDetail }; return viewModel; }; Post["initializedeployment"] = parameters => { var model = this.BindAndValidate<DeploymentModel>(); if (!this.ModelValidationResult.IsValid) { return 400; } DeployBlog(model); deploymentRepository.AddDeployment(model); Thread.Sleep(2500); return "deployed"; }; Post["/alreadyregistered"] = parameters => { var model = this.Bind<AlreadyRegisteredModel>(); var alreadyRegistered = deploymentRepository.IsUserAndRepoRegistered(model.AzureDeployment, model.Repo, model.Username); var keys = new List<string>(); keys.Add(model.AzureDeployment ? "azurerepo" : "ftpserver"); return new { isValid = !alreadyRegistered, keys = keys }; }; }
public VersionCertifier(ISystemClock clock, ISecurityContext securityContext, IDeploymentRepository repository) { _clock = clock; _securityContext = securityContext; _repository = repository; }
public DeploymentRecorder(ISecurityContext securityContext, IDeploymentFactory factory, IDeploymentRepository repository) { _securityContext = securityContext; _factory = factory; _repository = repository; }
public IndexModule(IRootPathProvider rootPathProvider, IUserRepository userRepository, IDeploymentRepository deploymentRepository) { Post["/"] = parameters => { var payloadModel = this.Bind<GithubHookModel.RootObject>(); //Check if user is registered var githubhookfromUsername = payloadModel.repository.owner.name; var githubhookfromRepo = payloadModel.repository.url; if (!userRepository.UserRegistered(githubhookfromUsername, githubhookfromRepo)) return HttpStatusCode.Forbidden; var gitLocation = ConfigurationManager.AppSettings["GitLocation"]; var repoPath = rootPathProvider.GetRootPath() + ".git"; if (!Directory.Exists(repoPath)) { var cloneProcess = Process.Start(gitLocation + " clone " + payloadModel.repository.url + " " + repoPath); if (cloneProcess != null) cloneProcess.WaitForExit(); } else { //Shell out to git.exe as LibGit2Sharp doesnt support Merge yet var pullProcess = Process.Start(gitLocation + " --git-dir=\"" + repoPath + "\" pull upstream master"); if (pullProcess != null) pullProcess.WaitForExit(); } //Run the PreCompiler var addProcess = Process.Start(gitLocation + " --git-dir=\"" + repoPath + "\" add -A"); if (addProcess != null) addProcess.WaitForExit(); var commitProcess = Process.Start(gitLocation + " --git-dir=\"" + repoPath + "\" commit -a -m \"Static Content Regenerated\""); if (commitProcess != null) commitProcess.WaitForExit(); var pushProcess = Process.Start("C:\\Program Files (x86)\\Git\bin\\git.exe --git-dir=\"" + repoPath + "\" push upstream master"); if (pushProcess != null) pushProcess.WaitForExit(); return 200; }; Get["/"] = parameters => { return View["Index"]; }; Get["/repos"] = parameters => { return View["Repos"]; }; Get["getrepodata/{githubuser}"] = parameters => { var githubUser = (string)parameters.githubuser; var client = new RestClient("https://api.github.com"); var request = new RestRequest("users/" + githubUser + "/repos"); request.AddHeader("Accept", "application/json"); var response = client.Execute<List<GithubUserRepos.RootObject>>(request); var repoDetail = response.Data .Where(x => x.fork == false) .Select( x => new RepoDetail { Name = x.name, AvatarUrl = x.owner.avatar_url, Description = x.description, HtmlUrl = x.html_url, UpdatedAt = DateTime.Parse(x.pushed_at).ToRelativeTime(), CloneUrl = x.clone_url }); var viewModel = new RepoModel { Username = githubUser, Repos = repoDetail }; return viewModel; }; Post["initializedeployment"] = parameters => { var model = this.BindAndValidate<DeploymentModel>(); if (!this.ModelValidationResult.IsValid) { } return "deployed"; }; Post["/alreadyregistered"] = parameters => { string repo = (string) Request.Form.repo; var alreadyRegistered = deploymentRepository.IsUserAndRepoRegistered(); return alreadyRegistered; }; }
/// <summary> /// Downloads application from the remote directory to the local file system. /// </summary> /// <param name="applicationRootPath">The target path where the applications will be downloaded</param> /// <param name="deploymentRepository"></param> public ApplicationDownloader(string applicationRootPath, IDeploymentRepository deploymentRepository) { _applicationRootPath = applicationRootPath; _deploymentRepository = deploymentRepository; }
public void BeforeEach() { // TODO: When a dedicated test database is in place, use the real repository here: deploymentRepository = new FakeDeploymentRepository(); }
public CreateDeploymentHandler(IDeploymentRepository deploymentRepository, IMapper mapper) { _deploymentRepository = deploymentRepository; _mapper = mapper; }
public AbstractApiDeploymentRequestModelValidator(IDeploymentRepository deploymentRepository) { this.deploymentRepository = deploymentRepository; }
public SqlScriptTokenValueProvider(IDeploymentRepository deploymentRepo, string serverName) { _deploymentRepo = deploymentRepo; _serverName = serverName; InitConstants(); }
public IndexModule(IGithubUserRepository githubUserRepository, IDeploymentRepository deploymentRepository, IRootPathProvider rootPathProvider) { this.githubUserRepository = githubUserRepository; this.rootPathProvider = rootPathProvider; this.snowPreCompilerPath = rootPathProvider.GetRootPath() + "PreCompiler\\Sandra.Snow.Precompiler.exe"; Post["/"] = parameters => { var payloadModel = this.Bind <GithubHookModel.RootObject>(); //Check if user is registered var githubhookfromUsername = payloadModel.repository.owner.name; var githubhookfromRepo = payloadModel.repository.url; if (!githubUserRepository.UserRegistered(githubhookfromUsername, githubhookfromRepo)) { return(HttpStatusCode.Forbidden); } var deploymentModel = deploymentRepository.GetDeployment(githubhookfromUsername); DeployBlog(deploymentModel); return(200); }; Get["/"] = parameters => { return(View["Index"]); }; Get["/repos"] = parameters => { return(View["Repos"]); }; Get["getrepodata/{githubuser}"] = parameters => { var githubUser = (string)parameters.githubuser; var client = new RestClient("https://api.github.com"); var request = new RestRequest("users/" + githubUser + "/repos"); request.AddHeader("Accept", "application/json"); var response = client.Execute <List <GithubUserRepos.RootObject> >(request); var repoDetail = response.Data //.Where(x => x.fork == false) .Select( x => new RepoDetail { Name = x.name, AvatarUrl = x.owner.avatar_url, Description = x.description, HtmlUrl = x.html_url, UpdatedAt = DateTime.Parse(x.pushed_at).ToRelativeTime(), CloneUrl = x.clone_url }); var viewModel = new RepoModel { Username = githubUser, Repos = repoDetail }; return(viewModel); }; Post["initializedeployment"] = parameters => { var model = this.BindAndValidate <DeploymentModel>(); if (!this.ModelValidationResult.IsValid) { return(400); } DeployBlog(model); deploymentRepository.AddDeployment(model); Thread.Sleep(2500); return("deployed"); }; Post["/alreadyregistered"] = parameters => { var model = this.Bind <AlreadyRegisteredModel>(); var alreadyRegistered = deploymentRepository.IsUserAndRepoRegistered(model.AzureDeployment, model.Repo, model.Username); var keys = new List <string>(); keys.Add(model.AzureDeployment ? "azurerepo" : "ftpserver"); return(new { isValid = !alreadyRegistered, keys = keys }); }; }
public RemoteApplicationDeploymentDirectory(IDeploymentRepository deploymentRepository, IAppDeploymentMatcher appDeploymentMatcher) { _deploymentRepository = deploymentRepository; _appDeploymentMatcher = appDeploymentMatcher; }
public ApiDeploymentRequestModelValidator(IDeploymentRepository deploymentRepository) : base(deploymentRepository) { }
public AuditRepository(MongoUrl mongoUrl, IMongoClient mongoClient, IDeploymentRepository deploymentRepository) : base(mongoUrl, mongoClient) { this.deploymentRepository = deploymentRepository; collection = MongoDatabase.GetCollection<DeploymentAudit>(AuditCollection); }
public BlobStorageDeploymentRepositoryTest(AzureStorageEmulatorTestFixture fixture) { fixture.ClearBlobStorage(); _blobClient = fixture.BlobClient; _deploymentRepository = new BlobStorageDeploymentRepository(Constants.EmulatorDataConnectionString); }
public AuditRepository(MongoUrl mongoUrl, IMongoClient mongoClient, IDeploymentRepository deploymentRepository) : base(mongoUrl, mongoClient) { this.deploymentRepository = deploymentRepository; collection = MongoDatabase.GetCollection <DeploymentAudit>(AuditCollection); }