コード例 #1
0
 public GitServerHttpHandler(ITracer tracer, IGitServer gitServer, IOperationLock deploymentLock, IDeploymentManager deploymentManager)
 {
     _gitServer         = gitServer;
     _tracer            = tracer;
     _deploymentLock    = deploymentLock;
     _deploymentManager = deploymentManager;
 }
コード例 #2
0
 public UploadPackHandler(ITracer tracer,
                          IGitServer gitServer,
                          IOperationLock deploymentLock,
                          IDeploymentManager deploymentManager)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
 }
コード例 #3
0
 private CustomGitRepositoryHandler CreateHandler(
     IGitServer gitServer = null,
     UploadPackHandler uploadPackHandler  = null,
     IRepositoryFactory repositoryFactory = null,
     IEnvironment environment             = null)
 {
     return(new CustomGitRepositoryHandler(t =>
     {
         if (t == typeof(ITracer))
         {
             return Mock.Of <ITracer>();
         }
         else if (t == typeof(IGitServer))
         {
             return gitServer ?? Mock.Of <IGitServer>();
         }
         else if (t == typeof(UploadPackHandler))
         {
             return new UploadPackHandler(
                 Mock.Of <ITracer>(),
                 Mock.Of <IGitServer>(),
                 Mock.Of <IOperationLock>(),
                 Mock.Of <IDeploymentManager>());
         }
         else if (t == typeof(IRepositoryFactory))
         {
             return repositoryFactory ?? Mock.Of <IRepositoryFactory>();
         }
         else if (t == typeof(IEnvironment))
         {
             return environment ?? Mock.Of <IEnvironment>();
         }
         throw new NotImplementedException("type " + t.Name + " is not implemented!");
     }));
 }
コード例 #4
0
ファイル: InfoRefsService.cs プロジェクト: loudej/kudu
 public InfoRefsService(ITracer tracer, IGitServer gitServer, IEnvironment environment, RepositoryConfiguration configuration)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentTargetPath = environment.DeploymentTargetPath;
     _configuration = configuration;
 }
コード例 #5
0
 private InfoRefsController CreateController(IGitServer gitServer = null,
                                             IDeploymentManager deploymentManager = null,
                                             IDeploymentSettingsManager settings = null,
                                             IRepositoryFactory repositoryFactory = null)
 {
     return new InfoRefsController(Mock.Of<ITracer>(), gitServer ?? Mock.Of<IGitServer>(), repositoryFactory ?? Mock.Of<IRepositoryFactory>());
 }
コード例 #6
0
ファイル: RpcService.cs プロジェクト: izevaka/kudu
 public RpcService(ITracer tracer,
                   IGitServer gitServer,
                   IOperationLock deploymentLock)
 {
     _gitServer      = gitServer;
     _tracer         = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #7
0
ファイル: ReceivePackHandler.cs プロジェクト: lookworld/kudu
 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager,
                           IDeploymentSettingsManager settings)
     : base(tracer, gitServer, deploymentLock, deploymentManager, settings)
 {
 }
コード例 #8
0
ファイル: ReceivePackService.cs プロジェクト: randome/kudu
 public ReceivePackService(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #9
0
ファイル: RpcController.cs プロジェクト: rguerreiro/kudu
 public RpcController(ITracer tracer,
                   IGitServer gitServer,
                   IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #10
0
 public InfoRefsController(
     ITracer tracer,
     IGitServer gitServer,
     IRepositoryFactory repositoryFactory)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _repositoryFactory = repositoryFactory;
 }
コード例 #11
0
ファイル: ReceivePackHandler.cs プロジェクト: albertjan/kudu
 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager,
                           IRepositoryFactory repositoryFactory)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
     _repositoryFactory = repositoryFactory;
 }
コード例 #12
0
 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager,
                           IRepositoryFactory repositoryFactory)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
     _repositoryFactory = repositoryFactory;
 }
コード例 #13
0
 protected GitServerHttpHandler(ITracer tracer,
                                IGitServer gitServer,
                                IOperationLock deploymentLock,
                                IDeploymentManager deploymentManager)
 {
     GitServer         = gitServer;
     Tracer            = tracer;
     DeploymentLock    = deploymentLock;
     DeploymentManager = deploymentManager;
 }
コード例 #14
0
 protected GitServerHttpHandler(ITracer tracer, 
                             IGitServer gitServer, 
                             IOperationLock deploymentLock, 
                             IDeploymentManager deploymentManager)
 {
     GitServer = gitServer;
     Tracer = tracer;
     DeploymentLock = deploymentLock;
     DeploymentManager = deploymentManager;
 }
コード例 #15
0
ファイル: RpcService.cs プロジェクト: loudej/kudu
 public RpcService(ITracer tracer,
                   IGitServer gitServer,
                   IDeploymentManagerFactory deploymentManagerFactory,
                   IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _deploymentManagerFactory = deploymentManagerFactory;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #16
0
ファイル: ReceivePackHandlerFacts.cs プロジェクト: 40a/kudu
 private ReceivePackHandler CreateHandler(IGitServer gitServer = null, 
                                         IDeploymentManager deploymentManager = null, 
                                         IDeploymentSettingsManager settings = null, 
                                         IRepositoryFactory repositoryFactory = null)
 {
     return new ReceivePackHandler(Mock.Of<ITracer>(),
                                   gitServer ?? Mock.Of<IGitServer>(),
                                   Mock.Of<IOperationLock>(),
                                   deploymentManager ?? Mock.Of<IDeploymentManager>(),
                                   repositoryFactory ?? Mock.Of<IRepositoryFactory>());
 }
コード例 #17
0
 private ReceivePackHandler CreateHandler(IGitServer gitServer = null,
                                          IDeploymentManager deploymentManager = null,
                                          IDeploymentSettingsManager settings  = null,
                                          IRepositoryFactory repositoryFactory = null)
 {
     return(new ReceivePackHandler(Mock.Of <ITracer>(),
                                   gitServer ?? Mock.Of <IGitServer>(),
                                   Mock.Of <IOperationLock>(),
                                   deploymentManager ?? Mock.Of <IDeploymentManager>(),
                                   repositoryFactory ?? Mock.Of <IRepositoryFactory>()));
 }
コード例 #18
0
ファイル: FetchHandler.cs プロジェクト: vlad-c/kudu
 public FetchHandler(ITracer tracer,
                     IGitServer gitServer,
                     IDeploymentManager deploymentManager,
                     IOperationLock deploymentLock,
                     RepositoryConfiguration configuration)
 {
     _gitServer = gitServer;
     _deploymentManager = deploymentManager;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
     _configuration = configuration;
 }
コード例 #19
0
 public void Invoke(
     HttpContext context,
     ITracer tracer,
     IGitServer gitServer,
     IDictionary <string, IOperationLock> namedLocks,
     IDeploymentManager deploymentManager)
 {
     GitServer         = gitServer;
     Tracer            = tracer;
     DeploymentManager = deploymentManager;
     DeploymentLock    = namedLocks["deployment"];
 }
コード例 #20
0
ファイル: InfoRefsController.cs プロジェクト: remcoros/kudu
 public InfoRefsController(
     ITracer tracer,
     IGitServer gitServer,
     IDeploymentManager deploymentManager,
     IEnvironment environment,
     RepositoryConfiguration configuration)
 {
     _gitServer = gitServer;
     _deploymentManager = deploymentManager;
     _tracer = tracer;
     _webRootPath = environment.WebRootPath;
     _configuration = configuration;
 }
コード例 #21
0
ファイル: FetchHandler.cs プロジェクト: ashbrener/kudu
 public FetchHandler(ITracer tracer,
                     IGitServer gitServer,
                     IDeploymentManager deploymentManager,
                     IDeploymentSettingsManager settings,
                     IOperationLock deploymentLock,
                     RepositoryConfiguration configuration,
                     IEnvironment environment)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
     _settings      = settings;
     _configuration = configuration;
     _environment   = environment;
 }
コード例 #22
0
 public InfoRefsController(
     ITracer tracer,
     IGitServer gitServer,
     IDeploymentManager deploymentManager,
     IEnvironment environment,
     RepositoryConfiguration configuration)
 {
     _gitServer         = gitServer;
     _deploymentManager = deploymentManager;
     _tracer            = tracer;
     _webRootPath       = environment.WebRootPath;
     _configuration     = configuration;
 }
コード例 #23
0
ファイル: InfoRefsController.cs プロジェクト: lookworld/kudu
 public InfoRefsController(
     ITracer tracer,
     IGitServer gitServer,
     IDeploymentManager deploymentManager,
     IDeploymentSettingsManager settings,
     IEnvironment environment)
 {
     _gitServer = gitServer;
     _deploymentManager = deploymentManager;
     _tracer = tracer;
     _settings = settings;
     _webRootPath = environment.WebRootPath;
 }
コード例 #24
0
 public InfoRefsService(
     ITracer tracer,
     IGitServer gitServer,
     IDeploymentManager deploymentManager,
     IEnvironment environment,
     RepositoryConfiguration configuration)
 {
     _gitServer            = gitServer;
     _deploymentManager    = deploymentManager;
     _tracer               = tracer;
     _deploymentTargetPath = environment.DeploymentTargetPath;
     _configuration        = configuration;
 }
コード例 #25
0
ファイル: FetchHandler.cs プロジェクト: remcoros/kudu
 public FetchHandler(ITracer tracer,
                     IGitServer gitServer,
                     IDeploymentManager deploymentManager,
                     IDeploymentSettingsManager settings,
                     IOperationLock deploymentLock,
                     RepositoryConfiguration configuration,
                     IEnvironment environment)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
     _settings = settings;
     _configuration = configuration;
     _environment = environment;
 }
コード例 #26
0
        public Task Invoke(
            HttpContext context,
            ITracer tracer,
            IGitServer gitServer)
        {
            using (tracer.Step("RpcService.UploadPackHandler"))
            {
                UpdateNoCacheForResponse(context.Response);

                context.Response.ContentType = "application/x-git-{0}-result".With("upload-pack");

                gitServer.Upload(context.Request.Body, context.Response.Body);
            }

            return(Task.CompletedTask);
        }
コード例 #27
0
        private InfoRefsController CreateController(IGitServer gitServer = null,
                                                    IDeploymentManager deploymentManager = null,
                                                    IDeploymentSettingsManager settings  = null,
                                                    IRepositoryFactory repositoryFactory = null,
                                                    IEnvironment environment             = null,
                                                    IFileSystem fileSystem  = null,
                                                    IOperationLock initLock = null)
        {
            return(new InfoRefsController(t =>
            {
                if (t == typeof(ITracer))
                {
                    return Mock.Of <ITracer>();
                }
                else if (t == typeof(IGitServer))
                {
                    return gitServer ?? Mock.Of <IGitServer>();
                }
                else if (t == typeof(IDeploymentSettingsManager))
                {
                    return settings ?? Mock.Of <IDeploymentSettingsManager>();
                }
                else if (t == typeof(IRepositoryFactory))
                {
                    return repositoryFactory ?? Mock.Of <IRepositoryFactory>();
                }
                else if (t == typeof(IEnvironment))
                {
                    return environment ?? Mock.Of <IEnvironment>();
                }
                else if (t == typeof(IFileSystem))
                {
                    return fileSystem ?? Mock.Of <IFileSystem>();
                }
                else if (t == typeof(IOperationLock))
                {
                    return initLock ?? Mock.Of <IOperationLock>();
                }

                throw new NotImplementedException("type " + t.Name + " is not implemented!");
            }));
        }
コード例 #28
0
 public InfoRefsController(IGitServer gitServer, IRepositoryManager repositoryManager)
 {
     _gitServer = gitServer;
     _repositoryManager = repositoryManager;
 }
コード例 #29
0
ファイル: InfoRefsService.cs プロジェクト: piscisaureus/kudu
 public InfoRefsService(IProfiler profiler, IGitServer gitServer)
 {
     _gitServer = gitServer;
     _profiler = profiler;
 }
コード例 #30
0
 public GitServerHttpHandler(ITracer tracer, IGitServer gitServer, IOperationLock deploymentLock)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #31
0
        public async Task Invoke(
            HttpContext context,
            ITracer tracer,
            IGitServer gitServer,
            IDictionary <string, IOperationLock> namedLocks,
            IDeploymentManager deploymentManager,
            IRepositoryFactory repositoryFactory,
            IEnvironment environment)
        {
            //Get the deployment lock from the locks dictionary
            var deploymentLock = namedLocks["deployment"];

            using (tracer.Step("RpcService.ReceivePack"))
            {
                // Ensure that the target directory does not have a non-Git repository.
                IRepository repository = repositoryFactory.GetRepository();
                if (repository != null && repository.RepositoryType != RepositoryType.Git)
                {
                    context.Response.StatusCode = StatusCodes.Status400BadRequest;
                    return;
                }

                try
                {
                    await deploymentLock.LockOperationAsync(() =>
                    {
                        context.Response.ContentType = "application/x-git-receive-pack-result";

                        if (PostDeploymentHelper.IsAutoSwapOngoing())
                        {
                            context.Response.StatusCode = StatusCodes.Status409Conflict;
                            var msg = Encoding.UTF8.GetBytes(Resources.Error_AutoSwapDeploymentOngoing);
                            return(context.Response.Body.WriteAsync(msg, 0, msg.Length));
                        }

                        string username = null;
                        if (AuthUtility.TryExtractBasicAuthUser(context.Request, out username))
                        {
                            gitServer.SetDeployer(username);
                        }

                        UpdateNoCacheForResponse(context.Response);

                        // This temporary deployment is for ui purposes only, it will always be deleted via finally.
                        ChangeSet tempChangeSet;
                        using (deploymentManager.CreateTemporaryDeployment(Resources.ReceivingChanges, out tempChangeSet))
                        {
                            // to pass to kudu.exe post receive hook
                            System.Environment.SetEnvironmentVariable(Constants.RequestIdHeader, environment.RequestId);
                            try
                            {
                                gitServer.Receive(context.Request.Body, context.Response.Body);
                            }
                            finally
                            {
                                System.Environment.SetEnvironmentVariable(Constants.RequestIdHeader, null);
                            }
                        }

                        return(Task.CompletedTask);
                    }, "Handling git receive pack", TimeSpan.Zero);
                }
                catch (LockOperationException ex)
                {
                    context.Response.StatusCode = StatusCodes.Status409Conflict;
                    var msg = Encoding.UTF8.GetBytes(ex.Message);
                    await context.Response.Body.WriteAsync(msg, 0, msg.Length);
                }
            }
        }
コード例 #32
0
 public CodebaseHqHandler(IGitServer gitServer)
     : base(gitServer)
 {
 }
コード例 #33
0
        private CustomGitRepositoryHandler CreateHandler(
                                                   IGitServer gitServer = null,
                                                   UploadPackHandler uploadPackHandler = null,
                                                   IRepositoryFactory repositoryFactory = null,
                                                   IEnvironment environment = null)
        {

            return new CustomGitRepositoryHandler(t =>
            {
                if (t == typeof(ITracer))
                {
                    return Mock.Of<ITracer>();
                }
                else if (t == typeof(IGitServer))
                {
                    return gitServer ?? Mock.Of<IGitServer>();
                }
                else if (t == typeof(UploadPackHandler))
                {
                    return new UploadPackHandler(
                        Mock.Of<ITracer>(),
                        Mock.Of<IGitServer>(),
                        Mock.Of<IOperationLock>(),
                        Mock.Of<IDeploymentManager>());
                }
                else if (t == typeof(IRepositoryFactory))
                {
                    return repositoryFactory ?? Mock.Of<IRepositoryFactory>();
                }
                else if (t == typeof(IEnvironment))
                {
                    return environment ?? Mock.Of<IEnvironment>();
                }
                throw new NotImplementedException("type " + t.Name + " is not implemented!");
            });
        }
コード例 #34
0
 public CodePlexHandler(IGitServer gitServer)
 {
     _gitServer = gitServer;
 }
コード例 #35
0
 public GitlabHqHandler(IGitServer gitServer)
     : base(gitServer)
 {
 }
コード例 #36
0
        private InfoRefsController CreateController(IGitServer gitServer = null,
                                                    IDeploymentManager deploymentManager = null,
                                                    IDeploymentSettingsManager settings = null,
                                                    IRepositoryFactory repositoryFactory = null,
                                                    IEnvironment environment = null,
                                                    IFileSystem fileSystem = null,
                                                    IOperationLock initLock = null)
        {
            return new InfoRefsController(t =>
            {
                if (t == typeof(ITracer))
                {
                    return Mock.Of<ITracer>();
                }
                else if (t == typeof(IGitServer))
                {
                    return gitServer ?? Mock.Of<IGitServer>();
                }
                else if (t == typeof(IDeploymentSettingsManager))
                {
                    return settings ?? Mock.Of<IDeploymentSettingsManager>();
                }
                else if (t == typeof(IRepositoryFactory))
                {
                    return repositoryFactory ?? Mock.Of<IRepositoryFactory>();
                }
                else if (t == typeof(IEnvironment))
                {
                    return environment ?? Mock.Of<IEnvironment>();
                }
                else if (t == typeof(IFileSystem))
                {
                    return fileSystem ?? Mock.Of<IFileSystem>();
                }
                else if (t == typeof(IOperationLock))
                {
                    return initLock ?? Mock.Of<IOperationLock>();
                }

                throw new NotImplementedException("type " + t.Name + " is not implemented!");
            });
        }
コード例 #37
0
 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock)
     : base(tracer, gitServer, deploymentLock)
 {
 }
コード例 #38
0
 public GitServerHttpHandler(ITracer tracer, IGitServer gitServer, IOperationLock deploymentLock)
 {
     _gitServer      = gitServer;
     _tracer         = tracer;
     _deploymentLock = deploymentLock;
 }
コード例 #39
0
ファイル: GithubHandler.cs プロジェクト: dpvreony-forks/kudu
 public GitHubHandler(IGitServer gitServer)
     : base(gitServer)
 {
 }
コード例 #40
0
ファイル: RpcService.cs プロジェクト: piscisaureus/kudu
 public RpcService(IProfiler profiler, IGitServer gitServer, IDeploymentManagerFactory deploymentManagerFactory)
 {
     _gitServer = gitServer;
     _deploymentManagerFactory = deploymentManagerFactory;
     _profiler = profiler;
 }
コード例 #41
0
 public ReceivePackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock)
     : base(tracer, gitServer, deploymentLock)
 {
 }
コード例 #42
0
 public BitbucketHandler(IGitServer gitServer)
 {
     _gitServer = gitServer;
 }
コード例 #43
0
 public GitHubCompatHandler(IGitServer gitServer)
 {
     _gitServer = gitServer;
 }
コード例 #44
0
ファイル: RpcController.cs プロジェクト: RaleighHokie/kudu
 public RpcController(IGitServer gitServer,
                      IDeploymentManager deploymentManager)
 {
     _gitServer = gitServer;
     _deploymentManager = deploymentManager;
 }
コード例 #45
-1
 public GitServerHttpHandler(ITracer tracer, IGitServer gitServer, IOperationLock deploymentLock, IDeploymentManager deploymentManager)
 {
     _gitServer = gitServer;
     _tracer = tracer;
     _deploymentLock = deploymentLock;
     _deploymentManager = deploymentManager;
 }
コード例 #46
-1
ファイル: UploadPackHandler.cs プロジェクト: 40a/kudu
 public UploadPackHandler(ITracer tracer,
                           IGitServer gitServer,
                           IOperationLock deploymentLock,
                           IDeploymentManager deploymentManager)
     : base(tracer, gitServer, deploymentLock, deploymentManager)
 {
 }