Exemple #1
0
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Enable file design mode");
            var tsManager     = new TerrasoftManager();
            var appConfigPath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName, BpmonlineConstants.WorkspaceConsoleAppConfigRelativePath);

            tsManager.UpadteFileDesignModeWorkspaceConsole(appConfigPath, true);
            Logger.WriteCommandSuccess();
        }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Set WorkspaceConsole prefer 32 bit");
            var tsManager = new TerrasoftManager();
            var workspaceConsoleCsprojPath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName, BpmonlineConstants.WorkspaceConsoleCsprojRelativePath);

            Logger.WriteCommandAddition($"File path: {workspaceConsoleCsprojPath}");
            tsManager.SetWorkspaceConsolePrefer32Bit(workspaceConsoleCsprojPath, true);
            Logger.WriteCommandSuccess();
        }
Exemple #3
0
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Update WorkspaceConsole connection string");
            var tsManager = new TerrasoftManager();
            var workspaceConsoleAppConfigPath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName, BpmonlineConstants.WorkspaceConsoleAppConfigRelativePath);
            var connectionString = DbManager.CreateConnectionString(Context.Settings.MSSSQLConnectionString, Context.DatabaseName);

            tsManager.UpdateWCConnectionString(workspaceConsoleAppConfigPath, connectionString);
            Logger.WriteCommandSuccess();
        }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Update redis connection string");
            var tsManager = new TerrasoftManager();
            var connectionStringFilePath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName,
                                                        @"TSBpm\Src\Lib\Terrasoft.WebApp.Loader\ConnectionStrings.config");
            var appConString = Context.Settings.RedisConnectionString.Replace("##dbname##", (new Random()).Next(1, 16).ToString());

            tsManager.UpdateRedisConnectionString(connectionStringFilePath, appConString);
            Logger.WriteCommandSuccess();
        }
Exemple #5
0
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Update connection string for Integration Unit Tests");
            var projectDirectoryPath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName);
            var tsManager            = new TerrasoftManager();
            var configPath           = Path.Combine(projectDirectoryPath, BpmonlineConstants.ConfigurationIntegrationConnectionStringRelativePath);
            var connectionString     = DbManager.CreateConnectionString(Context.Settings.MSSSQLConnectionString, Context.DatabaseName);

            tsManager.UpdateIntegrationConnectionString(configPath, connectionString);
            Logger.WriteCommandSuccess();
        }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Update loader web.config");
            var tsManager         = new TerrasoftManager();
            var webConfigFilePath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName,
                                                 BpmonlineConstants.WebAppLoaderWebConfigRelativePath);

            tsManager.UpdateFileDesignMode(webConfigFilePath, true);
            tsManager.UpdateDbGeneralSection(webConfigFilePath);
            Logger.WriteCommandSuccess();
        }
Exemple #7
0
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Update database connection string");
            var tsManager            = new TerrasoftManager();
            var connectionStringPath = Path.Combine(Context.Settings.ProjectsPath, Context.ProjectDirectoryName,
                                                    BpmonlineConstants.WebAppLoaderConnectionStringsRelativePath);
            var connectionString = Context.Settings.MSSSQLConnectionString.Replace("##dbname##", Context.DatabaseName);

            tsManager.UpdateDbConnectionString(connectionStringPath, connectionString);
            Logger.WriteCommandSuccess();
        }
Exemple #8
0
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Delete all cultures except ru-RU and en-US");
            var tsManager = new TerrasoftManager();
            var script    = tsManager.GetClearCultureScript();
            var dbManager = new DbManager();

            dbManager.MSSSQLConnectionString = Context.Settings.MSSSQLConnectionString;
            dbManager.DataBase = Context.DatabaseName;
            dbManager.ExecSqlScript(script);
            Logger.WriteCommandSuccess();
        }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Prepare database");
            var tsManager       = new TerrasoftManager();
            var prepareDbScript = tsManager.CreatePrepareDevDatabaseScript(context.Settings.PackageStorePath);
            var dbManager       = new DbManager();

            dbManager.MSSSQLConnectionString = Context.Settings.MSSSQLConnectionString;
            dbManager.DataBase = Context.DatabaseName;
            dbManager.ExecSqlScript(prepareDbScript);
            Logger.WriteCommandSuccess();
        }
 private List <string> GetDevPackages()
 {
     if (string.Equals(Context.Settings.Packages.Trim(), "*"))
     {
         var databaseManager = new DbManager();
         databaseManager.MSSSQLConnectionString = Context.Settings.MSSSQLConnectionString;
         databaseManager.DataBase = Context.DatabaseName;
         var tsManager = new TerrasoftManager();
         var pkg       = tsManager.GetPackeges(databaseManager);
         return(pkg);
     }
     return(SplitPackegesSetting(Context.Settings.Packages));
 }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Prepare packages");
            var tsManager   = new TerrasoftManager();
            var devPackages = GetDevPackages();
            var dbManager   = new DbManager();

            dbManager.MSSSQLConnectionString = Context.Settings.MSSSQLConnectionString;
            dbManager.DataBase = Context.DatabaseName;
            foreach (var package in devPackages)
            {
                var preparePackageScript = tsManager.CreatePrepareDevPackageScript(package);
                dbManager.ExecSqlScript(preparePackageScript);
                Logger.WriteCommandAddition($"{package} ");
            }
            Logger.WriteCommandSuccess();
        }
        protected override void InternalExecute(Context context)
        {
            Logger.WriteCommand("Restore database");
            var tsManager             = new TerrasoftManager();
            var originalBakFilePath   = tsManager.GetDatabaseBackupFilePath(Context.TempUnzippedBuildDirectory);
            var tempSharedBakFilePath = ShareDatabaseBakFile(originalBakFilePath);
            var dbManager             = new DbManager();

            dbManager.MSSSQLConnectionString = Context.Settings.MSSSQLConnectionString;
            var databaseName         = CreateDatabaseName();
            var restoredDatabaseName = dbManager.RestoreBpmonlineDbWithUniqueName(tempSharedBakFilePath, databaseName);

            Context.DatabaseName = restoredDatabaseName;
            DeleteFile(tempSharedBakFilePath);
            Logger.WriteCommandAddition($"Database name: {restoredDatabaseName}");
            var cleanManager = new CleanManager(context, Logger);

            cleanManager.CleanTempUnzippedBuildDirectory();
            Logger.WriteCommandSuccess();
        }