public override ValidationsGroup Create(ProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            ValidationsGroup validationsGroup = new ValidationsGroup(true);

            DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext;
            DBVersionsProcessArgs    dbVersionsProcessArgs    = dbVersionsProcessContext.ProcessArgs as DBVersionsProcessArgs;


            TargetStateScriptFileExistValidator targetStateScriptFileExistValidatorInc = new TargetStateScriptFileExistValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.IncScriptFileName);

            validationsGroup.Add(targetStateScriptFileExistValidatorInc);

            TargetScriptFileAlreadyExecutedValidator isTargetScriptFiletAlreadyExecutedValidatorInc =
                new TargetScriptFileAlreadyExecutedValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.IncScriptFileName);

            validationsGroup.Add(isTargetScriptFiletAlreadyExecutedValidatorInc);


            //if (dbVersionsProcessContext.ProjectConfig.DevEnvironment)
            //{
            //    TargetStateScriptFileExistValidator targetStateScriptFileExistValidatorDDD = new TargetStateScriptFileExistValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.DDDScriptFileName);
            //    validationsGroup.Add(targetStateScriptFileExistValidatorDDD);

            //    TargetScriptFileAlreadyExecutedValidator isTargetScriptFiletAlreadyExecutedValidatorDDD =
            //    new TargetScriptFileAlreadyExecutedValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer, dbVersionsProcessArgs.TargetScripts.DDDScriptFileName);
            //    validationsGroup.Add(isTargetScriptFiletAlreadyExecutedValidatorDDD);
            //}

            return(validationsGroup);
        }
        public override ValidationsGroup Create(ProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            ProjectConfigItem projectConfig = (processContext as CommonProcessContext).ProjectConfig;

            DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext;


            ValidationsGroup validationsGroup = new ValidationsGroup(false);

            NewProjectValidator newProjectValidator =
                new NewProjectValidator(_dbCommandsFactory,
                                        projectConfig.DevEnvironment,
                                        projectConfig.DBConnectionInfo,
                                        dbVersionsProcessContext.ScriptFilesState);

            validationsGroup.Add(newProjectValidator);

            SystemTablesValidator systemTablesValidator = new SystemTablesValidator(_dbCommandsFactory, projectConfig.DevEnvironment, projectConfig.DBConnectionInfo);

            validationsGroup.Add(systemTablesValidator);

            return(validationsGroup);
        }
Exemplo n.º 3
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            processContext.ScriptFilesState = _scriptFilesStateFactory.Create();
            processContext.ScriptFilesState.Reload(processContext.ProjectConfig);
        }
Exemplo n.º 4
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            string id = (processContext.ProcessArgs as DBVersionsProcessArgs).Id;

            processContext.SetProjectConfig(_projectConfigsStorage.GetProjectConfigById(id));
        }
Exemplo n.º 5
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
            {
                DataSet dsExecutionHistory = dbCommands.GetScriptsExecutionHistoryTableStructureFromDB();

                DataTable dbScriptsExecutionHistoryTable      = dsExecutionHistory.Tables[DBCommandsConsts.DBScriptsExecutionHistoryFullTableName];
                DataTable dbScriptsExecutionHistoryFilesTable = dsExecutionHistory.Tables[DBCommandsConsts.DBScriptsExecutionHistoryFilesFullTableName];

                processContext.EndProcessDateTime = DateTime.Now;

                DataRow executionHistoryRow = dbScriptsExecutionHistoryTable.NewRow();

                executionHistoryRow["DBScriptsExecutionHistoryID"] = 0;

                executionHistoryRow["StartProcessDateTime"] = processContext.StartProcessDateTime;
                executionHistoryRow["ExecutionTypeName"]    = processContext.ProcessDefinition.EngineTypeName;
                executionHistoryRow["EndProcessDateTime"]   = processContext.EndProcessDateTime;
                executionHistoryRow["ProcessDurationInMs"]  = processContext.ProcessDurationInMs;
                executionHistoryRow["NumOfScriptFiles"]     = processContext.ExecutedFiles.Count;
                executionHistoryRow["DBBackupFileFullPath"] = processContext.DBBackupFileFullPath;
                executionHistoryRow["IsVirtualExecution"]   = processContext.IsVirtualExecution;

                dbScriptsExecutionHistoryTable.Rows.Add(executionHistoryRow);
                dbCommands.UpdateScriptsExecutionHistoryTableToDB(dbScriptsExecutionHistoryTable);


                foreach (var executedFiles in processContext.ExecutedFiles)
                {
                    DataRow newFileRow = dbScriptsExecutionHistoryFilesTable.NewRow();

                    newFileRow["DBScriptsExecutionHistoryID"] = 0;
                    newFileRow["ExecutedDateTime"]            = DateTime.Now;
                    newFileRow["Filename"]                 = executedFiles.Filename;
                    newFileRow["FileFullPath"]             = executedFiles.FileFullPath;
                    newFileRow["ScriptFileType"]           = executedFiles.ScriptFileType.FileTypeCode;
                    newFileRow["IsVirtualExecution"]       = processContext.IsVirtualExecution;
                    newFileRow["ComputedFileHash"]         = executedFiles.ComputedHash;
                    newFileRow["ComputedFileHashDateTime"] = executedFiles.ComputedHashDateTime;


                    dbScriptsExecutionHistoryFilesTable.Rows.Add(newFileRow);
                }


                int currDBScriptsExecutionHistoryID = Convert.ToInt32(executionHistoryRow["DBScriptsExecutionHistoryID"], CultureInfo.InvariantCulture);

                foreach (DataRow fileRow in dbScriptsExecutionHistoryFilesTable.Rows)
                {
                    fileRow["DBScriptsExecutionHistoryID"] = currDBScriptsExecutionHistoryID;
                }

                dbCommands.UpdateScriptsExecutionHistoryFilesTableToDB(dbScriptsExecutionHistoryFilesTable);
            }
        }
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            if (!processContext.IsVirtualExecution)
            {
                _dbCommands.ExecSQLCommandStr(_scriptBlockToExecute);
            }
        }
Exemplo n.º 7
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
            {
                dbCommands.RecreateDBVersionsTables();
            }

            processContext.ScriptFilesState.Reload(processContext.ProjectConfig);
        }
Exemplo n.º 8
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            DBVersionsProcessArgs dbVersionsProcessArgs = processContext.ProcessArgs as DBVersionsProcessArgs;

            var scriptFilesComparer = processContext.ScriptFilesState.ScriptFilesComparers[_scriptFileType.FileTypeCode];

            RuntimeScriptFile newScriptFile = scriptFilesComparer.CreateNextNewScriptFile(dbVersionsProcessArgs.NewScriptName);

            processContext.Results = newScriptFile.FileFullPath;
        }
Exemplo n.º 9
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            while (!IsCompleted)
            {
                if (ProcessExpetion != null)
                {
                    throw ProcessExpetion;
                }

                Thread.Sleep(15);
            }
        }
Exemplo n.º 10
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            if (!processContext.ProjectConfig.DevEnvironment)
            {
                throw new Exception(CoreTextResources.CantDropDBOnDelEnvException);
            }

            using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
            {
                dbCommands.DropAllDBObject();
            }
        }
Exemplo n.º 11
0
        private static string GetLastIncFilename(DBVersionsProcessContext processContext)
        {
            string lastIncStriptFilename = "";


            RuntimeScriptFile lastIncScriptFiles = processContext.ScriptFilesState.IncrementalScriptFilesComparer.AllFileSystemScriptFiles.LastOrDefault();

            if (lastIncScriptFiles != null)
            {
                lastIncStriptFilename = lastIncScriptFiles.Filename;
            }

            return(lastIncStriptFilename);
        }
        public override ValidationsGroup Create(ProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext;
            DBVersionsProcessArgs    dbVersionsProcessArgs    = dbVersionsProcessContext.ProcessArgs as DBVersionsProcessArgs;

            ValidationsGroup validationsGroup = new ValidationsGroup(false);

            NextScriptFileNameValidator nextScriptFileNameValidator = new NextScriptFileNameValidator(dbVersionsProcessContext.ScriptFilesState.ScriptFilesComparers[_scriptFileType.FileTypeCode], dbVersionsProcessArgs.NewScriptName);

            validationsGroup.Add(nextScriptFileNameValidator);


            return(validationsGroup);
        }
Exemplo n.º 13
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));


            using (ArtifactExtractor _currentArtifactExtractor = _artifactExtractorFactory.Create(processContext.ProjectConfig))
            {
                List <ActionStepBase> internalSteps = new List <ActionStepBase>();

                using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
                {
                    ScriptFileTypeBase       incrementalFileType = ScriptFileTypeBase.Create <IncrementalScriptFileType>();
                    ExecuteScriptsByTypeStep incrementalExecuteScriptsByTypeStep = _executeScriptsByTypeStepFactory.Create(incrementalFileType.FileTypeCode, dbCommands);
                    internalSteps.Add(incrementalExecuteScriptsByTypeStep);


                    string lastIncStriptFilename = GetLastIncFilename(processContext);

                    TargetScripts targetScripts = null;
                    if (processContext.ProcessArgs != null)
                    {
                        targetScripts = (processContext.ProcessArgs as DBVersionsProcessArgs).TargetScripts;
                    }

                    //Comment: We run the repeatable files and ddd files, onlyif we have all the schema on the DB. mean, only if we executed all incremiental files.
                    if (targetScripts.IncScriptFileName.Trim().ToUpperInvariant() == lastIncStriptFilename.Trim().ToUpperInvariant() ||
                        targetScripts.IncScriptFileName.Trim().ToUpperInvariant() == RuntimeScriptFile.TargetLastScriptFileName.Trim().ToUpperInvariant())
                    {
                        ScriptFileTypeBase       repeatableFileType = ScriptFileTypeBase.Create <RepeatableScriptFileType>();
                        ExecuteScriptsByTypeStep repeatableFileTypeExecuteScriptsByTypeStep = _executeScriptsByTypeStepFactory.Create(repeatableFileType.FileTypeCode, dbCommands);
                        internalSteps.Add(repeatableFileTypeExecuteScriptsByTypeStep);


                        if (processContext.ScriptFilesState.DevDummyDataScriptFilesComparer != null)
                        {
                            ScriptFileTypeBase       devDummyDataFileType = ScriptFileTypeBase.Create <DevDummyDataScriptFileType>();
                            ExecuteScriptsByTypeStep devDummyDataFileTypeExecuteScriptsByTypeStep = _executeScriptsByTypeStepFactory.Create(devDummyDataFileType.FileTypeCode, dbCommands);
                            internalSteps.Add(devDummyDataFileTypeExecuteScriptsByTypeStep);
                        }
                    }


                    ExecuteInternalSteps(internalSteps, false);
                }
            }
        }
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));


            if (processContext.ScriptFilesState.DevDummyDataScriptFilesComparer != null)
            {
                using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
                {
                    List <ActionStepBase> internalSteps = new List <ActionStepBase>();

                    (processContext.ProcessDefinition as DBVersionsProcessDefinition).IsVirtualExecution = true;

                    ScriptFileTypeBase       devDummyDataFileType = ScriptFileTypeBase.Create <DevDummyDataScriptFileType>();
                    ExecuteScriptsByTypeStep devDummyDataFileTypeExecuteScriptsByTypeStep = _executeScriptsByTypeStepFactory.Create(devDummyDataFileType.FileTypeCode, dbCommands);
                    internalSteps.Add(devDummyDataFileTypeExecuteScriptsByTypeStep);

                    ExecuteInternalSteps(internalSteps, false);
                }
            }
        }
Exemplo n.º 15
0
        public override ValidationsGroup Create(ProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            ValidationsGroup validationsGroup = new ValidationsGroup(false);

            DBVersionsProcessContext dbVersionsProcessContext = processContext as DBVersionsProcessContext;

            HistoryExecutedFilesChangedValidator isHistoryExecutedFilesChangedValidatorInc =
                new HistoryExecutedFilesChangedValidator(dbVersionsProcessContext.ScriptFilesState.IncrementalScriptFilesComparer);

            validationsGroup.Add(isHistoryExecutedFilesChangedValidatorInc);

            if (dbVersionsProcessContext.ProjectConfig.DevEnvironment)
            {
                HistoryExecutedFilesChangedValidator isHistoryExecutedFilesChangedValidatorDDD =
                    new HistoryExecutedFilesChangedValidator(dbVersionsProcessContext.ScriptFilesState.DevDummyDataScriptFilesComparer);
                validationsGroup.Add(isHistoryExecutedFilesChangedValidatorDDD);
            }

            return(validationsGroup);
        }
Exemplo n.º 16
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));


            TargetScripts targetScripts = (processContext.ProcessArgs as DBVersionsProcessArgs).TargetScripts;
            //if (processContext.ProcessArgs != null)
            //{
            //    targetScripts = (processContext.ProcessArgs as DBVersionsProcessArgs).TargetScripts;
            //}

            ScriptFilesComparerBase scriptFilesComparer = processContext.ScriptFilesState.GetScriptFilesComparerByType(_fileTypeCode);

            if (!targetScripts.TargetScriptsByType.TryGetValue(_fileTypeCode, out string targetStateScriptFileName))
            {
                targetStateScriptFileName = null;
            }
            List <RuntimeScriptFile> scriptFilesList = scriptFilesComparer.GetPendingFilesToExecute(targetStateScriptFileName);

            List <ActionStepBase> internalSteps = new List <ActionStepBase>();

            foreach (RuntimeScriptFile scriptFile in scriptFilesList)
            {
                string ignoreStr = "";
                if (processContext.IsVirtualExecution)
                {
                    ignoreStr = CoreTextResources.IgnoreBecauseVirtualExecution;
                }

                string stepName = $"{scriptFile.Filename}{ignoreStr}";

                ExecuteSingleFileScriptStep executeSingleFileScriptStep = _executeSingleFileScriptStepFactory.Create(_dbCommands, stepName, scriptFile);

                internalSteps.Add(executeSingleFileScriptStep);
            }

            ExecuteInternalSteps(internalSteps, false);
        }
Exemplo n.º 17
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            if (!processContext.IsVirtualExecution)
            {
                string sqlCommandStr = File.ReadAllText(_scriptFile.FileFullPath);

                List <string> scriptBlocks = _dbCommands.SplitSqlStatementsToExecutionBlocks(sqlCommandStr).ToList();

                List <ActionStepBase> internalSteps = new List <ActionStepBase>();

                foreach (string scriptBlockStr in scriptBlocks)
                {
                    var executeScriptBlockStep = _executeScriptBlockStepFactory.Craete(_dbCommands, scriptBlockStr);
                    internalSteps.Add(executeScriptBlockStep);
                }

                ExecuteInternalSteps(internalSteps, false);
            }

            processContext.AppendExecutedFile(_scriptFile);
        }
Exemplo n.º 18
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));


            //notificationExecutersProvider.SetStepStartManually(100, "Restore process");

            using (var dbRestoreStatusNotifyer = _dbCommandsFactory.CreateDBProcessStatusNotifyer(typeof(DBRestoreStatusNotifyer), processContext.ProjectConfig.DBConnectionInfo).AsDisposable())
            {
                List <ActionStepBase> internalSteps = new List <ActionStepBase>();

                for (int internalStepNumber = 1; internalStepNumber <= 100; internalStepNumber++)
                {
                    ExternalProcessStatusStep externalProcessStatusStep = new ExternalProcessStatusStep(internalStepNumber);
                    internalSteps.Add(externalProcessStatusStep);
                }

                Exception processExpetion = null;


                dbRestoreStatusNotifyer.Instance.Start((precents) =>
                {
                    // notificationExecutersProvider.ForceStepProgress(Convert.ToInt32(precents));

                    foreach (ExternalProcessStatusStep step in internalSteps)
                    {
                        if (!step.IsCompleted)
                        {
                            step.SetProcessState((int)Math.Floor(precents), processExpetion);
                        }
                    }
                });

                Task.Run(() =>
                {
                    try
                    {
                        using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
                        {
                            using (var dbBackupRestoreCommands = _dbCommandsFactory.CreateDBBackupRestoreCommands(processContext.ProjectConfig.DBConnectionInfo))
                            {
                                dbBackupRestoreCommands.RestoreDBFromBackup(processContext.DBBackupFileFullPath, dbCommands.DataBaseName);

                                foreach (ExternalProcessStatusStep step in internalSteps)
                                {
                                    if (!step.IsCompleted)
                                    {
                                        step.SetProcessState(100, processExpetion);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        processExpetion = new NotificationProcessException(StepName, ex.Message, CoreTextResources.RestoreDBFailInstructionsMessage, NotificationErrorType.Error, ex);
                    }
                });

                ExecuteInternalSteps(internalSteps, true);

                dbRestoreStatusNotifyer.Instance.Stop();
            }
        }
Exemplo n.º 19
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            string timeStampStr = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture);

            string targetFileName;

            using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
            {
                targetFileName = $"bu_{ dbCommands.DataBaseName}_{timeStampStr}.bak";
            }

            string targetFileFullPath = Path.Combine(processContext.ProjectConfig.BackupFolderPath, targetFileName);

            FileSystemPathUtils.ResloveFilePath(targetFileFullPath);

            //notificationExecutersProvider.SetStepStartManually(100, "Backup process");

            using (var dbBackupStatusNotifyer = _dbCommandsFactory.CreateDBProcessStatusNotifyer(typeof(DBBackupStatusNotifyer), processContext.ProjectConfig.DBConnectionInfo).AsDisposable())
            {
                //DBProcessStatusNotifyerBase dbBackupStatusNotifyer = _dbProcessStatusNotifyerFactory.Create(, dbQueryStatus.Instance) as DBBackupStatusNotifyer;

                List <ActionStepBase> internalSteps = new List <ActionStepBase>();

                for (int internalStepNumber = 1; internalStepNumber <= 100; internalStepNumber++)
                {
                    ExternalProcessStatusStep externalProcessStatusStep = new ExternalProcessStatusStep(internalStepNumber);
                    internalSteps.Add(externalProcessStatusStep);
                }

                Exception processExpetion = null;


                dbBackupStatusNotifyer.Instance.Start(
                    (precents) =>
                {
                    //notificationExecutersProvider.ForceStepProgress(Convert.ToInt32(precents));

                    foreach (ExternalProcessStatusStep step in internalSteps)
                    {
                        if (!step.IsCompleted)
                        {
                            step.SetProcessState((int)Math.Floor(precents), processExpetion);
                        }
                    }
                });

                Task.Run(() =>
                {
                    try
                    {
                        using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
                        {
                            using (var dbBackupRestoreCommands = _dbCommandsFactory.CreateDBBackupRestoreCommands(processContext.ProjectConfig.DBConnectionInfo))
                            {
                                dbBackupRestoreCommands.CreateDBBackup(targetFileFullPath, dbCommands.DataBaseName);

                                foreach (ExternalProcessStatusStep step in internalSteps)
                                {
                                    if (!step.IsCompleted)
                                    {
                                        step.SetProcessState(100, processExpetion);
                                    }
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        processExpetion = ex;
                    }
                });

                ExecuteInternalSteps(internalSteps, false);

                dbBackupStatusNotifyer.Instance.Stop();

                if (processExpetion != null)
                {
                    throw processExpetion; //new Exception("CreateBackupStep", processExpetion);
                }

                processContext.DBBackupFileFullPath = targetFileFullPath;
            }
        }
Exemplo n.º 20
0
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            using (var dbCommands = _dbCommandsFactory.CreateDBCommand(processContext.ProjectConfig.DBConnectionInfo))
            {
                string dbName = dbCommands.DataBaseName;


                string tempFolderForDeploy = Path.Combine(_settings.TempFolderPath, $"Deploy_{dbName}_{DateTime.Now:HH-mm-dd-fff}");
                if (!Directory.Exists(tempFolderForDeploy))
                {
                    Directory.CreateDirectory(tempFolderForDeploy);
                }



                ScriptFileTypeBase incrementalScriptFileType = ScriptFileTypeBase.Create <IncrementalScriptFileType>();

                string incrementalSubFolderToDeploy = Path.Combine(tempFolderForDeploy, incrementalScriptFileType.RelativeFolderName);
                if (!Directory.Exists(incrementalSubFolderToDeploy))
                {
                    Directory.CreateDirectory(incrementalSubFolderToDeploy);
                }

                DirectoryInfo diIncremental = new DirectoryInfo(processContext.ProjectConfig.IncrementalScriptsFolderPath);
                foreach (FileInfo scriptFileToCopy in diIncremental.GetFiles())
                {
                    string targetFilename = Path.Combine(incrementalSubFolderToDeploy, scriptFileToCopy.Name);
                    scriptFileToCopy.CopyTo(targetFilename, true);
                }


                ScriptFileTypeBase repeatableScriptFileType = ScriptFileTypeBase.Create <RepeatableScriptFileType>();

                string repeatableSubFolderToDeploy = Path.Combine(tempFolderForDeploy, repeatableScriptFileType.RelativeFolderName);
                if (!Directory.Exists(repeatableSubFolderToDeploy))
                {
                    Directory.CreateDirectory(repeatableSubFolderToDeploy);
                }

                DirectoryInfo diRepeatable = new DirectoryInfo(processContext.ProjectConfig.RepeatableScriptsFolderPath);
                foreach (FileInfo scriptFileToCopy in diRepeatable.GetFiles())
                {
                    string targetFilename = Path.Combine(repeatableSubFolderToDeploy, scriptFileToCopy.Name);
                    scriptFileToCopy.CopyTo(targetFilename, true);
                }



                if (!Directory.Exists(processContext.ProjectConfig.DeployArtifactFolderPath))
                {
                    Directory.CreateDirectory(processContext.ProjectConfig.DeployArtifactFolderPath);
                }

                string targetFileFullPath = Path.Combine(processContext.ProjectConfig.DeployArtifactFolderPath, $"{dbName}{ArtifactExtractor.ArtifactFilenameExtension}");

                if (File.Exists(targetFileFullPath))
                {
                    File.Delete(targetFileFullPath);
                }

                ZipFile.CreateFromDirectory(tempFolderForDeploy, targetFileFullPath);

                processContext.Results = targetFileFullPath;
            }
        }
        public override void Execute(DBVersionsProcessContext processContext)
        {
            processContext.ThrowIfNull(nameof(processContext));

            processContext.Results = processContext.ScriptFilesState;
        }