public void RecycleWeb(BranchInfo branch)
        {
            string strWebConfig = string.Format(@"{0}\Web\web.config", this.Convention.GetLocalPath(branch));
            if(!this.FileSystemAdapter.Exists(strWebConfig)) return;

            this.FileSystemAdapter.UpdateTimestamp(strWebConfig);
        }
        public void CreateDatabase(BranchInfo branch)
        {
            this.TextOutput.WriteVerbose("Creating Database");
            this.Database.Create(branch);

            this.TextOutput.WriteVerbose("Preparing Ablage");
            this.Ablage.Reset(branch);
        }
        public void RestoreDatabase(BranchInfo branch, string strFile)
        {
            this.TextOutput.WriteVerbose("Restoring Database");
            this.Database.Restore(branch, strFile);

            this.TextOutput.WriteVerbose("Preparing Ablage");
            this.Ablage.Reset(branch);
        }
        public void AddReleasebranch(BranchInfo branch)
        {
            this.TextOutput.WriteVerbose("Creating Branch");
            this.VersionControl.CreateBranch(branch);

            this.TextOutput.WriteVerbose("Creating Build configuration");
            this.AdeNet.CreateBuildDefinition(branch);
        }
        public void RemoveReleasebranch(BranchInfo branch)
        {
            this.TextOutput.WriteVerbose("Deleting Mapping (if any)");
            this.VersionControl.DeleteMapping(branch);

            this.TextOutput.WriteVerbose("Deleting Branch");
            this.VersionControl.DeleteBranch(branch);
        }
Пример #6
0
        public BranchType GetBranchType(BranchInfo branch)
        {
            var followedConvention = (from convention in this.BranchConventionRegistry.GetAllConventions()
                                      where convention.BranchnameFollowsConvention(branch.Name)
                                      select convention).Single();

            return followedConvention.BranchType;
        }
        public void DeleteMapping(BranchInfo branch)
        {
            string strLocalPath = this.Convention.GetLocalPath(branch);
            string strServerPath = this.Convention.GetServerPath(branch);

            this.TextOutput.WriteVerbose(string.Format("Unmapping {0}", branch));

            this.VersionControlAdapter.DeleteMapping(strServerPath, strLocalPath);
            this.VersionControlAdapter.Get();
        }
        public void CreateMapping(BranchInfo branch)
        {
            string strLocalPath = this.Convention.GetLocalPath(branch);
            string strServerPath = this.Convention.GetServerPath(branch);

            if(!this.VersionControlAdapter.ServerItemExists(strServerPath)) throw new ArgumentException(string.Format("Serverpath {0} for {1} does not exist.", strServerPath, branch));

            this.TextOutput.WriteVerbose(string.Format("Mapping {0} to {1}", strServerPath, strLocalPath));

            this.VersionControlAdapter.CreateMapping(strServerPath, strLocalPath);
            this.VersionControlAdapter.Get(strServerPath);
        }
        public void DeleteBranch(BranchInfo branch)
        {
            string strBranchBasePath = this.Convention.GetServerBasePath(branch);

            if(!this.VersionControlAdapter.ServerItemExists(strBranchBasePath))
            {
                this.TextOutput.WriteVerbose(string.Format("{0} is already deleted. Skipping...", strBranchBasePath));
                return;
            }

            this.TextOutput.WriteVerbose(string.Format("Destroying {0}", strBranchBasePath));
            this.VersionControlAdapter.DeleteBranch(strBranchBasePath);
        }
        public void CreateBranch(BranchInfo branch)
        {
            string strSourceBranch = this.Convention.GetServerPath(this.Convention.MainBranch(branch.TeamProject));
            string strTargetBranch = this.Convention.GetServerPath(branch);
            string strVersionByLabel = GetVersionSpec(branch);

            if(this.VersionControlAdapter.ServerItemExists(strTargetBranch))
            {
                this.TextOutput.WriteVerbose(string.Format("Branch {0} already exists. Skipping...", strTargetBranch));
                return;
            }

            this.VersionControlAdapter.CreateBranch(strSourceBranch, strTargetBranch, strVersionByLabel);
        }
        private void MergeChangeset(string strChangeset, BranchInfo sourceBranch, string[] targetBranches)
        {
            if(this.Convention.GetBranchType(sourceBranch) == BranchType.Release)
            {
                BranchInfo mainBranch = this.Convention.MainBranch(sourceBranch.TeamProject);
                strChangeset = this.VersionControl.MergeChangeset(strChangeset, sourceBranch, mainBranch);

                if(targetBranches.Length == 1 && targetBranches.Single() == mainBranch.Name) return;

                sourceBranch = this.Convention.MainBranch(sourceBranch.TeamProject);
            }

            this.VersionControl.MergeChangeset(strChangeset, sourceBranch, BranchInfo.CreateSet(sourceBranch.TeamProject, targetBranches));
        }
        public void RemoveMapping(BranchInfo branch)
        {
            this.TextOutput.WriteVerbose("Resetting IIS");
            this.Environment.RecycleWeb(branch);

            this.TextOutput.WriteVerbose("Deleting Mapping");
            this.VersionControl.DeleteMapping(branch);

            this.TextOutput.WriteVerbose("Cleaning up IIS");
            this.AdeNetExeAdapter.CleanupIIS(branch);

            this.TextOutput.WriteVerbose("Deleting Solution");
            this.FileSystem.DeleteDirectory(this.Convention.GetLocalPath(branch));

            this.TextOutput.WriteVerbose("Dropping Database");
            this.Database.Drop(branch);

            this.TextOutput.WriteVerbose("Removing Ablage");
            this.Ablage.Remove(branch);
        }
        public void GetLatest(BranchInfo branch, bool bOpenSolution, bool bOpenWeb)
        {
            this.TextOutput.WriteVerbose("Getting latest Version");
            this.VersionControl.GetLatest(branch);

            this.TextOutput.WriteVerbose("Installing Packages");
            this.AdeNet.InstallPackages(branch);

            this.TextOutput.WriteVerbose("Building Solution");
            this.BuildEngine.Build(branch);

            this.TextOutput.WriteVerbose("Migrating Database");
            this.Database.Migrate(branch);

            if(bOpenSolution)
            {
                OpenSolution(branch);
            }

            if(bOpenWeb)
            {
                this.Environment.OpenWeb(branch);
            }
        }
 public static string GetApplicationName(BranchInfo branch)
 {
     return string.Format(@"DevelopmentbranchConventionDummy.GetApplicationName {0}", branch);
 }
 public static string GetLocalDatabase(BranchInfo branch)
 {
     return string.Format(@"DevelopmentbranchConventionDummy.GetLocalDatabase {0}", branch);
 }
 string IBranchConvention.GetServerSourcePath(BranchInfo branch)
 {
     return GetServerPath(branch);
 }
 string IBranchConvention.GetSolutionFile(BranchInfo branch)
 {
     return GetSolutionFile(branch);
 }
 public static string GetServerBasePath(BranchInfo branch)
 {
     return string.Format(@"MainbranchConventionDummy.GetServerBasePath {0}", branch);
 }
 public static string GetLocalPath(BranchInfo branch)
 {
     return string.Format(@"ReleasebranchConventionDummy.GetLocalPath {0}", branch);
 }
 public static string GetServerPath(BranchInfo branch)
 {
     return string.Format(@"DevelopmentbranchConventionDummy.GetServerPath {0}", branch);
 }
 string IBranchConvention.GetLocalDatabase(BranchInfo branch)
 {
     return GetLocalDatabase(branch);
 }
 string IBranchConvention.GetAblagePath(BranchInfo branch)
 {
     return GetAblagePath(branch);
 }
 public static string GetServerBasePath(BranchInfo branch)
 {
     return string.Format(@"DevelopmentbranchConventionDummy.GetServerBasePath/{0}/{1}", branch.TeamProject, branch.Name);
 }
Пример #24
0
 public string GetLocalDatabase(BranchInfo branch)
 {
     return Convention(branch).GetLocalDatabase(branch);
 }
 public static string GetSolutionFile(BranchInfo branch)
 {
     return string.Format(@"DevelopmentbranchConventionDummy.GetSolutionFile {0}", branch);
 }
Пример #26
0
 public string GetLocalPath(BranchInfo branch)
 {
     return Convention(branch).GetLocalPath(branch);
 }
 string IBranchConvention.GetApplicationName(BranchInfo branch)
 {
     return GetApplicationName(branch);
 }
Пример #28
0
 public string GetServerPath(BranchInfo branch)
 {
     return Convention(branch).GetServerSourcePath(branch);
 }
 string IBranchConvention.GetLocalPath(BranchInfo branch)
 {
     return GetLocalPath(branch);
 }
Пример #30
0
 public string GetSolutionFile(BranchInfo branch)
 {
     return Convention(branch).GetSolutionFile(branch);
 }