Exemplo n.º 1
0
        private void btnRestoreBackup_Click(object sender, EventArgs e)
        {
            string pathBackup;
            {
                var fbd = new FolderBrowserDialog();
                fbd.SelectedPath = this._PC_RootBackups.Value;

                var dr = fbd.ShowDialog();

                if (dr != DialogResult.OK && dr != DialogResult.Yes)
                {
                    return;
                }

                pathBackup = StringControls.NormalizeFolderPath(fbd.SelectedPath);
            }

            string msg = string.Format("Restoring Backup ({0}) to Production-Live", Path.GetDirectoryName(pathBackup));

            List <Tuple <Func <IReadOnlyCollection <string> >, string> > commands = new List <Tuple <Func <IReadOnlyCollection <string> >, string> >();

            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(pathBackup, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), msg));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyWebConfig(this._PC_ConfigProductionLive.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying web.config to Production-Live"));

            this.RunCommands(msg, commands);
        }
Exemplo n.º 2
0
        private void btnReleaseDemoBeta_Click(object sender, EventArgs e)
        {
            this.CheckForBadWebConfig();
            List <Tuple <Func <IReadOnlyCollection <string> >, string> > commands = new List <Tuple <Func <IReadOnlyCollection <string> >, string> >();

            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.ClearFolder(this._PC_RootDemoBeta.Value, this.UpdateTaskStatus, this._Log, IORetries), "Clearing Demo/Beta"));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(this._PC_RootSource.Value, this._PC_RootDemoBeta.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying Build Source to Demo/Beta"));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyWebConfig(this._PC_ConfigDemoBeta.Value, this._PC_RootDemoBeta.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying web.config to Demo/Beta"));

            this.RunCommands("Releasing Demo/Beta", commands);
        }
Exemplo n.º 3
0
        private void btnRestoreStable_Click(object sender, EventArgs e)
        {
            List <Tuple <Func <IReadOnlyCollection <string> >, string> > commands = new List <Tuple <Func <IReadOnlyCollection <string> >, string> >();

            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(this._PC_RootStable.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Restoring from Stable to Production-Live"));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyWebConfig(this._PC_ConfigProductionLive.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying web.config to Production-Live"));

            this.RunCommands("Restoring from Stable to Production-Live", commands);
        }
Exemplo n.º 4
0
        private void btnReleaseLive_Click(object sender, EventArgs e)
        {
            /* Clear    Stable
             * Copy     Production-Clean        to Stable
             * Copy     Production-Clean        to Backups
             * Copy     Stable.config           to Stable
             * Clear    Production-Clean
             * Copy     Build Source            to Production-Clean
             * if(Clear-Production-Live)        then        Clear Production-Live
             * Copy     Build Source            to Production-Live
             * Copy     Production-Live.config  to Production-Live
             * /**/

            this.CheckForBadWebConfig();
            List <Tuple <Func <IReadOnlyCollection <string> >, string> > commands = new List <Tuple <Func <IReadOnlyCollection <string> >, string> >();

            if (this.chkReleaseLive_CopyCurrentReleaseToStable.Checked)
            {
                commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.ClearFolder(this._PC_RootStable.Value, this.UpdateTaskStatus, this._Log, IORetries), "Clearing Stable"));
                commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(this._PC_RootProductionClean.Value, this._PC_RootStable.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying Production-Clean to Stable"));
                commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyWebConfig(this._PC_ConfigStable.Value, this._PC_RootStable.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying web.config to Stable"));
            }
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.BackupFolder(this._PC_RootProductionClean.Value, this._PC_RootBackups.Value, this.UpdateTaskStatus, this._Log, IORetries), "Backing up Production-Clean"));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.ClearFolder(this._PC_RootProductionClean.Value, this.UpdateTaskStatus, this._Log, IORetries), "Clearing Production-Clean"));
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(this._PC_RootSource.Value, this._PC_RootProductionClean.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying Build Source to Production-Clean"));

            if (this.chkReleaseLive_CleanBeforeRelease.Checked)
            {
                commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.ClearFolder(this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Clearing Production-Live"));
            }

            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyFolder(this._PC_RootSource.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying Build Source to Production-Live"));
            if (this.chkReleaseLive_CleanAfterRelease.Checked)
            {
                commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.ClearExtraFiles(this._PC_RootSource.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Clearing extra files from Production-Live that don't exist in build source"));
            }
            commands.Add(new Tuple <Func <IReadOnlyCollection <string> >, string>(() => FileOperations.CopyWebConfig(this._PC_ConfigProductionLive.Value, this._PC_RootProductionLive.Value, this.UpdateTaskStatus, this._Log, IORetries), "Copying web.config to Production-Live"));

            this.RunCommands("Releasing Production-Live", commands);
        }