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(); }
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(); }
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)); } }