예제 #1
0
        public IRootBranch Build(IRootBranchExtended sourceBranch, Action <ProgressCallbackData> progressCallback)
        {
            //branch components
            var newRootBranchFolder = BranchComponents(sourceBranch,
                                                       branchingProgress =>
            {
                //branching progress represents 80% from total
                var newPercentage = branchingProgress.Percentage * 80m / 100m;
                progressCallback?.Invoke(new ProgressCallbackData(newPercentage, branchingProgress.ActionDescription));
            });

            //create brach instance
            progressCallback?.Invoke(new ProgressCallbackData(80, $"Create first Publish.xml"));
            var newBranchInstance = _createRootBranchInstance(newRootBranchFolder.ToSourceControlFolder());

            DoTheFirstPublish(newBranchInstance);

            //create branch in the approval system
            progressCallback?.Invoke(new ProgressCallbackData(85, $"Create branch in the GGP Approval System"));
            CreateBranchInApprovalSystem(sourceBranch.Version);

            //GetLatest
            progressCallback?.Invoke(new ProgressCallbackData(95, $"GetLatest for {newRootBranchFolder.GetServerPath().AsString()}"));
            newRootBranchFolder.ToSourceControlFolder().GetLatest();

            progressCallback?.Invoke(new ProgressCallbackData(100, "Done"));

            return(newBranchInstance);
        }
예제 #2
0
        public void CreateRootBranch(IRootBranchExtended sourceBranch,
                                     Action <ProgressCallbackData> progressCallback)
        {
            var newBranch = new RootBranchBuilder(TfsGateway, CreateRootBranch, () => _serviceLocator.GetInstance <IPublishPayloadBuilder>())
                            .Build(sourceBranch,
                                   progressCallback);

            _logicalBranches.Add(newBranch);
            _serviceLocator.GetInstance <IPubSubMediator>().Publish(new NewRootBranchEventData(newBranch));
        }
예제 #3
0
        private Folders.IRootFolder BranchComponents(IRootBranchExtended sourceBranch, Action <ProgressCallbackData> progressCallback)
        {
            var newRootFolder = _tfsGateway.CreateRootFolder(sourceBranch.Version + 1);

            new BranchBuilder(newRootFolder.QA.Main,
                              sourceBranch.GetQaBranch().GetComponents(),
                              sourceBranch.Location.QA.Main,
                              progressCallback)
            .Build();
            return(newRootFolder);


            //return _tfsGateway.GetRootFolder(sourceBranch.Version + 1);
        }