Esempio n. 1
0
        public RootBranch(Folders.RootBranchFolder location, IServiceLocator serviceLocator)
        {
            if (!location.QA.Exists())
            {
                throw new ArgumentException($"There is no QA branch in {location.Name}");
            }

            _location             = location;
            _serviceLocator       = serviceLocator;
            _mainDevBranchBuilder = _serviceLocator.GetInstance <IMainDevBranchBuilder>();
            _productionBranch     = new ProductionBranch(_location.PROD, this, _serviceLocator);
        }
Esempio n. 2
0
        public void Build(Folders.RootBranchFolder logicalBranchFolder,
                          IEnumerable <ILogicalComponent> sourceComponents,
                          Action <ProgressCallbackData> progressCallback = null)
        {
            if (logicalBranchFolder == null)
            {
                throw new ArgumentNullException(nameof(logicalBranchFolder));
            }

            if (sourceComponents == null)
            {
                throw new ArgumentNullException(nameof(sourceComponents));
            }

            if (DevBranchExists(logicalBranchFolder))
            {
                throw new InvalidOperationException($"DEV branch already exists in {logicalBranchFolder.Name}");
            }

            if (InProgress)
            {
                throw new InvalidOperationException("DEV branch creation already in progress");
            }



            InProgress = true;

            try
            {
                var branchBuilder = new BranchBuilder(logicalBranchFolder.DEV.Main.Create(),
                                                      sourceComponents,
                                                      logicalBranchFolder.QA.Main,
                                                      progressCallback);
                branchBuilder.Build();
            }
            finally
            {
                InProgress = false;
            }
        }
Esempio n. 3
0
 public IRootBranch CreateRootBranch(Folders.RootBranchFolder logicalBranchFolder)
 {
     return(new RootBranch(logicalBranchFolder, _serviceLocator));
 }
Esempio n. 4
0
        private IRootBranch CreateRootBranch(ISourceControlFolder folder)
        {
            var rootBranchFolder = new Folders.RootBranchFolder(TfsGateway.GetRootServerPath(), folder);

            return(_serviceLocator.GetInstance <ILogicalBranchComponentFactory>().CreateRootBranch(rootBranchFolder));
        }
Esempio n. 5
0
 private bool DevBranchExists(Folders.RootBranchFolder logicalBranchFolder)
 {
     return(logicalBranchFolder.DEV.Main.Components.Exists());
 }
Esempio n. 6
0
 public bool CanBuild(Folders.RootBranchFolder logicalBranchFolder)
 {
     return(!(InProgress || DevBranchExists(logicalBranchFolder)));
 }