Ejemplo n.º 1
0
 public MigrationEngine(IHost host, ILogger <MigrationEngine> log, TelemetryClient telemetry, IEngineConfigurationBuilder configBuilder)
 {
     _Host      = host;
     _Log       = log;
     _Telemetry = telemetry;
     _Config    = configBuilder.BuildFromFile();
 }
Ejemplo n.º 2
0
 public MigrationEngineCore(IHost host, ILogger <MigrationEngineCore> log, ITelemetryLogger telemetry, IEngineConfigurationBuilder configBuilder)
 {
     _Host          = host;
     _Log           = log;
     _Telemetry     = telemetry;
     _Config        = configBuilder.BuildFromFile();
     _witdContainer = _Host.Services.GetRequiredService <TypeDefinitionMapContainer>();
     _pContainer    = _Host.Services.GetRequiredService <ProcessorContainer>();
     _grmContainer  = _Host.Services.GetRequiredService <GitRepoMapContainer>();
     ProcessConfiguration();
 }
 public EngineConfigurationWrapper(IEngineConfigurationBuilder engineConfigurationBuilder, ExecuteOptions opts, ILogger <EngineConfigurationWrapper> logger)
 {
     if (opts == null) //means that we are in init command and not execute
     {
         _engineConfiguration = engineConfigurationBuilder.BuildDefault();
         return;
     }
     if (opts.ConfigFile == string.Empty)
     {
         opts.ConfigFile = "configuration.json";
     }
     if (!File.Exists(opts.ConfigFile))
     {
         logger.LogInformation("The config file {ConfigFile} does not exist, nor does the default 'configuration.json'. Use '{ExecutableName}.exe init' to create a configuration file first", opts.ConfigFile, Assembly.GetEntryAssembly().GetName().Name);
         throw new ArgumentException("missing configfile");
     }
     logger.LogInformation("Config Found, creating engine host");
     _engineConfiguration = engineConfigurationBuilder.BuildFromFile(opts.ConfigFile);
 }