コード例 #1
0
 public DeploymentController(IApplicationRepository applicationRepository, IDeploymentRepository deploymentRepository, IApplicationHashingService applicationHashingService, IAuditRepository auditRepository)
 {
     this.applicationRepository = applicationRepository;
     this.deploymentRepository = deploymentRepository;
     this.applicationHashingService = applicationHashingService;
     this.auditRepository = auditRepository;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 public ProcessInputModelService(IInputModelToWidgetMapper inputModelToWidgetMapper,
     IDeploymentRepository deploymentRepository,
     IGetCurrentDateTime getCurrentDateTime)
 {
     this.getCurrentDateTime = getCurrentDateTime;
     this.deploymentRepository = deploymentRepository;
     this.inputModelToWidgetMapper = inputModelToWidgetMapper;
 }
コード例 #4
0
 public EnvironmentController(
     IDeploymentRepository deploymentRepository,
     IEnvironmentRepository environmentRepository,
     IPipelineRepository pipelineRepository)
 {
     _deploymentRepository = deploymentRepository;
     _environmentRepository = environmentRepository;
     _pipelineRepository = pipelineRepository;
 }
コード例 #5
0
 public DeploymentService(
     IEnvironmentRepository environmentRepository,
     IPipelineRepository pipelineRepository,
     IDeploymentRepository deploymentRepository,
     IDeploymentUtility deploymentUtility)
 {
     this.deploymentRepository = deploymentRepository;
     this.environmentRepository = environmentRepository;
     this.pipelineRepository = pipelineRepository;
     this.deploymentUtility = deploymentUtility;
 }
コード例 #6
0
ファイル: YamsServiceFactory.cs プロジェクト: youscan/Yams
        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);
        }
コード例 #7
0
ファイル: MainWindow.xaml.cs プロジェクト: mortezasoft/Yams
        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();
        }
コード例 #8
0
ファイル: MainWindow.xaml.cs プロジェクト: mortezasoft/Yams
        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);
        }
コード例 #9
0
 public DeploymentController(
     ILogger <DeploymentController> logger,
     IDeploymentRepository deploymentRepository,
     ICalendarRepository calendarRepository,
     ICompanyRepository companyRepository,
     IVehicleRepository vehicleRepository
     )
 {
     Logger = logger;
     DeploymentRepository = deploymentRepository;
     CalendarRepository   = calendarRepository;
     CompanyRepository    = companyRepository;
     VehicleRepository    = vehicleRepository;
 }
コード例 #10
0
ファイル: MainWindow.xaml.cs プロジェクト: mortezasoft/Yams
        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());
            }
        }
コード例 #11
0
        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);
        }
コード例 #12
0
ファイル: MainWindow.xaml.cs プロジェクト: mortezasoft/Yams
        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);
        }
コード例 #13
0
        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();
        }
コード例 #14
0
 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);
 }
コード例 #15
0
ファイル: DeploymentManager.cs プロジェクト: cburgdorf/kudu
 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;
 }
コード例 #16
0
        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;
            }
        }
コード例 #17
0
 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;
 }
コード例 #18
0
        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;
            }
        }
コード例 #19
0
 /// <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();
 }
コード例 #20
0
ファイル: YamsDiModule.cs プロジェクト: zhonli/Yams
        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);
        }
コード例 #21
0
 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)
 {
 }
コード例 #22
0
 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;
 }
コード例 #23
0
 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;
 }
コード例 #24
0
ファイル: YamsDiModule.cs プロジェクト: Microsoft/Yams
        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;
        }
コード例 #25
0
		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++;
			}
		}
コード例 #26
0
ファイル: DeployPackage.cs プロジェクト: mhinze/Tarantino
        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);
        }
コード例 #28
0
        public DeploymentsController()
        {
            var config = Settings.StorageConfiguration;

            this.repository = new DeploymentRepository(config);
        }
コード例 #29
0
ファイル: YamsDiModule.cs プロジェクト: Microsoft/Yams
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository, 
     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, updateSessionManager).Build();
 }
コード例 #30
0
 public DeploymentRepositoryTests(DatabaseFixture fixture)
 {
     Repository = new DeploymentRepository(fixture.Context);
 }
コード例 #31
0
ファイル: RemoteService.cs プロジェクト: kurthamilton/ODK
 public RemoteService(IServerRepository serverRepository, IDeploymentRepository deploymentRepository)
 {
     _deploymentRepository = deploymentRepository;
     _remoteFolderCache    = new Dictionary <string, IRemoteFolder>(StringComparer.OrdinalIgnoreCase);
     _serverRepository     = serverRepository;
 }
コード例 #32
0
 public DeploymentsController()
 {
     var config = Settings.StorageConfiguration;
     this.repository = new DeploymentRepository(config);
 }
コード例 #33
0
 public IndexViewModelBuilder(IDeploymentRepository deploymentRepository)
 {
     this.deploymentRepository = deploymentRepository;
 }
コード例 #34
0
 public RemoteApplicationDeploymentDirectory(IDeploymentRepository deploymentRepository)
 {
     _deploymentRepository = deploymentRepository;
 }
 public PerfCountersController()
 {
     var config = Settings.StorageConfiguration;
     this.repository = new PerfCounterRepository(config);
     this.deployments = new DeploymentRepository(config);
 }
コード例 #36
0
        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 };
                };
        }
コード例 #37
0
		public VersionCertifier(ISystemClock clock, ISecurityContext securityContext, IDeploymentRepository repository)
		{
			_clock = clock;
			_securityContext = securityContext;
			_repository = repository;
		}
コード例 #38
0
		public DeploymentRecorder(ISecurityContext securityContext, IDeploymentFactory factory, IDeploymentRepository repository)
		{
			_securityContext = securityContext;
			_factory = factory;
			_repository = repository;
		}
コード例 #39
0
ファイル: IndexModule.cs プロジェクト: kunjee17/Sandra.Snow
        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;
                };
        }
コード例 #40
0
ファイル: ApplicationDownloader.cs プロジェクト: ca-ta/Yams
 /// <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;
 }
コード例 #41
0
 public void BeforeEach()
 {
     // TODO: When a dedicated test database is in place, use the real repository here:
     deploymentRepository = new FakeDeploymentRepository();
 }
コード例 #42
0
 public CreateDeploymentHandler(IDeploymentRepository deploymentRepository, IMapper mapper)
 {
     _deploymentRepository = deploymentRepository;
     _mapper = mapper;
 }
コード例 #43
0
 public AbstractApiDeploymentRequestModelValidator(IDeploymentRepository deploymentRepository)
 {
     this.deploymentRepository = deploymentRepository;
 }
コード例 #44
0
 public SqlScriptTokenValueProvider(IDeploymentRepository deploymentRepo, string serverName)
 {
     _deploymentRepo = deploymentRepo;
     _serverName     = serverName;
     InitConstants();
 }
コード例 #45
0
        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 });
            };
        }
コード例 #46
0
 public RemoteApplicationDeploymentDirectory(IDeploymentRepository deploymentRepository, IAppDeploymentMatcher appDeploymentMatcher)
 {
     _deploymentRepository = deploymentRepository;
     _appDeploymentMatcher = appDeploymentMatcher;
 }
コード例 #47
0
 public ApiDeploymentRequestModelValidator(IDeploymentRepository deploymentRepository)
     : base(deploymentRepository)
 {
 }
コード例 #48
0
 public AuditRepository(MongoUrl mongoUrl, IMongoClient mongoClient, IDeploymentRepository deploymentRepository)
     : base(mongoUrl, mongoClient)
 {
     this.deploymentRepository = deploymentRepository;
     collection = MongoDatabase.GetCollection<DeploymentAudit>(AuditCollection);
 }
コード例 #49
0
 public BlobStorageDeploymentRepositoryTest(AzureStorageEmulatorTestFixture fixture)
 {
     fixture.ClearBlobStorage();
     _blobClient           = fixture.BlobClient;
     _deploymentRepository = new BlobStorageDeploymentRepository(Constants.EmulatorDataConnectionString);
 }
コード例 #50
0
 public AuditRepository(MongoUrl mongoUrl, IMongoClient mongoClient, IDeploymentRepository deploymentRepository)
     : base(mongoUrl, mongoClient)
 {
     this.deploymentRepository = deploymentRepository;
     collection = MongoDatabase.GetCollection <DeploymentAudit>(AuditCollection);
 }
コード例 #51
0
 public RemoteApplicationDeploymentDirectory(IDeploymentRepository deploymentRepository)
 {
     _deploymentRepository = deploymentRepository;
 }
コード例 #52
0
ファイル: YamsDiModule.cs プロジェクト: pikaih/Yams
 public YamsDiModule(YamsConfig config, IDeploymentRepository deploymentRepository,
                     IUpdateSessionManager updateSessionManager)
 {
     _container = RegisterTypes(config, deploymentRepository, updateSessionManager).Build();
 }
コード例 #53
0
 public VersionCertifier(ISystemClock clock, ISecurityContext securityContext, IDeploymentRepository repository)
 {
     _clock           = clock;
     _securityContext = securityContext;
     _repository      = repository;
 }