Пример #1
0
 public DeployComponent(IDependencyGraph<BranchInfo> branchGraph, string backupBranch, string activeBranch, IEnumerable<DatabaseInfo> databasesInfos) :
     base(null, "Done!")
 {
     var branchesByName = branchGraph.GetPath().ToDictionary(x => x.Name);
     mBranchGraph = branchGraph;
     mBackupBranch = branchesByName[backupBranch];
     mActiveBranch = branchesByName[activeBranch];
     mDatabasesInfos = databasesInfos.ToArray();
 }
Пример #2
0
        public DeployComponent(IDependencyGraph <BranchInfo> branchGraph, string backupBranch, string activeBranch, IEnumerable <DatabaseInfo> databasesInfos) :
            base(null, "Done!")
        {
            var branchesByName = branchGraph.GetPath().ToDictionary(x => x.Name);

            mBranchGraph    = branchGraph;
            mBackupBranch   = branchesByName[backupBranch];
            mActiveBranch   = branchesByName[activeBranch];
            mDatabasesInfos = databasesInfos.ToArray();
        }
Пример #3
0
        protected override IEnumerable <IComponent> GetComponentsToRun(string action, ComponentRunContext runContext)
        {
            foreach (var databaseInfo in mDatabasesInfos)
            {
                yield return(new RestoreDatabaseComponent(databaseInfo));
            }

            foreach (var branchInfo in mBranchGraph.GetPath(mBackupBranch, mActiveBranch))
            {
                yield return(new BranchComponent(branchInfo, mDatabasesInfos[0].Connection));
            }
        }