public RMReleaseTemplateRepository(string connectionString, string templateName, string templateStage, RMVersion version) { this.connectionString = connectionString; this.templateName = templateName; this.templateStage = templateStage; this.version = version; }
private static async Task <RMDeploymentSequence> RetrieveWorkflow(RMVersion version) { var repository = new RMReleaseTemplateRepository( options.ConnectionString, options.TemplateName, options.TemplateStage, version); PrintOnlyIfVerbose($"{Environment.NewLine}Connecting to the DB '{options.DatabaseName}' on the SQL server '{options.SqlServerName}'"); // get the workflow var workflow = await repository.GetDeploymentSequence(); return(workflow); }
private static async Task RetrieveWorkflowAndGenerateScript(RMVersion version, string releaseTemplateName, string releaseTemplateStage) { var workflow = await RetrieveWorkflow(version, releaseTemplateName, releaseTemplateStage); if (workflow != null) { PrintOnlyIfVerbose($"Generating the scripts for the workflow '{releaseTemplateName}' stage '{releaseTemplateStage}' into folder '{options.OutputFolder}'{Environment.NewLine}"); var scriptGenerator = ConfigureScriptGenerator(version); DeploymentSequence sequence; PrintOnlyIfVerbose("Parsing release template"); try { sequence = workflow.ToReleaseTemplate(); } catch (UnsupportedReleaseTemplateTypeException) { Console.WriteLine( $"Error: {options.TemplateName} is a vNext template. vNext release templates are unsupported. Please refer to the documentation for guidance on migrating vNext release templates."); return; } PrintOnlyIfVerbose("Done parsing release template"); PrintOnlyIfVerbose("Generating PowerShell"); await scriptGenerator.GenerateScriptAsync(sequence, options.OutputFolder); PrintOnlyIfVerbose("Done generating PowerShell"); Console.WriteLine($"{Environment.NewLine}Release workflow generated"); scriptGenerator.ScriptGenerationNotification -= PrintGeneratorEvents; ActionParser.ActionParsed -= PrintActionEvents; ContainerParser.ContainerParsed -= PrintContainerEvents; } else { Console.WriteLine( $"{Environment.NewLine}No Results returned for TemplateName: '{0}' and StageName: '{1}'\n", options.TemplateName, options.TemplateStage); } }
private static ScriptGenerator ConfigureScriptGenerator(RMVersion version) { // make sure we have the output folder var fs = new FileSystem(); fs.CreateDirectory(options.OutputFolder); var scriptGenerator = new ScriptGenerator( fs, new RMComponentRepository(options.ConnectionString, version), new RMUserRepository(options.ConnectionString, version), new RMDeployerToolRepository(options.ConnectionString, version), !options.CreateParameterizedScripts); // enable full logging scriptGenerator.ScriptGenerationNotification += PrintGeneratorEvents; ActionParser.ActionParsed += PrintActionEvents; ContainerParser.ContainerParsed += PrintContainerEvents; return(scriptGenerator); }
private static ScriptGenerator ConfigureScriptGenerator(RMVersion version) { PrintOnlyIfVerbose($"Generating the scripts for the workflow '{options.TemplateName}' stage '{options.TemplateStage}' into folder '{options.OutputFolder}'{Environment.NewLine}"); // make sure we have the output folder var fs = new FileSystem(); fs.CreateDirectory(options.OutputFolder); var scriptGenerator = new ScriptGenerator( fs, new RMComponentRepository(options.ConnectionString, version), new RMUserRepository(options.ConnectionString, version), new RMDeployerToolRepository(options.ConnectionString, version), !options.CreateParameterizedScripts); // enable full logging scriptGenerator.ScriptGenerationNotification += PrintGeneratorEvents; ActionParser.ActionParsed += PrintActionEvents; ContainerParser.ContainerParsed += PrintContainerEvents; return(scriptGenerator); }
public RMDeployerToolRepository(string connectionString, RMVersion version) { this.connectionString = connectionString; this.tableNamePrefix = version == RMVersion.Rm2015 ? "RM.tbl_" : "dbo."; }
public RMUserRepository(string connectionString, RMVersion version) { this.connectionString = connectionString; this.tableNamePrefix = version == RMVersion.Rm2015 ? "RM.tbl_" : "dbo."; }
private static async Task<RMDeploymentSequence> RetrieveWorkflow(RMVersion version, string releaseTemplateName, string releaseTemplateStage) { var repository = new RMReleaseTemplateRepository( options.ConnectionString, version); PrintOnlyIfVerbose($"{Environment.NewLine}Connecting to the DB '{options.DatabaseName}' on the SQL server '{options.SqlServerName}'"); // get the workflow var workflow = await repository.GetDeploymentSequence(releaseTemplateName, releaseTemplateStage); workflow.ReleaseTemplateName = releaseTemplateName; workflow.ReleaseTemplateStageName = releaseTemplateStage; return workflow; }
private static ScriptGenerator ConfigureScriptGenerator(RMVersion version) { // make sure we have the output folder var fs = new FileSystem(); fs.CreateDirectory(options.OutputFolder); var scriptGenerator = new ScriptGenerator( fs, new RMComponentRepository(options.ConnectionString, version), new RMUserRepository(options.ConnectionString, version), new RMDeployerToolRepository(options.ConnectionString, version), !options.CreateParameterizedScripts); // enable full logging scriptGenerator.ScriptGenerationNotification += PrintGeneratorEvents; ActionParser.ActionParsed += PrintActionEvents; ContainerParser.ContainerParsed += PrintContainerEvents; return scriptGenerator; }
public RMReleaseTemplateRepository(string connectionString, RMVersion version) { this.connectionString = connectionString; this.version = version; }
private static ScriptGenerator ConfigureScriptGenerator(RMVersion version) { PrintOnlyIfVerbose($"Generating the scripts for the workflow '{options.TemplateName}' stage '{options.TemplateStage}' into folder '{options.OutputFolder}'{Environment.NewLine}"); // make sure we have the output folder var fs = new FileSystem(); fs.CreateDirectory(options.OutputFolder); var scriptGenerator = new ScriptGenerator( fs, new RMComponentRepository(options.ConnectionString, version), new RMUserRepository(options.ConnectionString, version), new RMDeployerToolRepository(options.ConnectionString, version), !options.CreateParameterizedScripts); // enable full logging scriptGenerator.ScriptGenerationNotification += PrintGeneratorEvents; ActionParser.ActionParsed += PrintActionEvents; ContainerParser.ContainerParsed += PrintContainerEvents; return scriptGenerator; }