protected override void Configure()
 {
     if (Config.ChangeSetMappingFile != null)
     {
         if (System.IO.File.Exists(Config.ChangeSetMappingFile))
         {
             IChangeSetMappingProvider csmp = new ChangeSetMappingProvider(Config.ChangeSetMappingFile);
             csmp.ImportMappings(_ChangeSetMappings);
         }
     }
 }
Exemplo n.º 2
0
        public static void ExecuteEntryPoint(IHost host, ExecuteOptions opts)
        {
            var me = host.Services.GetRequiredService <Engine.MigrationEngine>();
            NetworkCredential sourceCredentials = null;
            NetworkCredential targetCredentials = null;

            if (!string.IsNullOrWhiteSpace(opts.SourceUserName) && !string.IsNullOrWhiteSpace(opts.SourcePassword))
            {
                sourceCredentials = new NetworkCredential(opts.SourceUserName, opts.SourcePassword, opts.SourceDomain);//new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(new NetworkCredential(opts.SourceUserName, opts.SourcePassword, opts.SourceDomain)));
            }
            if (!string.IsNullOrWhiteSpace(opts.TargetUserName) && !string.IsNullOrWhiteSpace(opts.TargetPassword))
            {
                targetCredentials = new NetworkCredential(opts.TargetUserName, opts.TargetPassword, opts.TargetDomain);//new VssCredentials(new Microsoft.VisualStudio.Services.Common.WindowsCredential(new NetworkCredential(opts.TargetUserName, opts.TargetPassword, opts.TargetDomain)));
            }
            me.AddNetworkCredentials(sourceCredentials, targetCredentials);
            if (!string.IsNullOrWhiteSpace(opts.ChangeSetMappingFile))
            {
                IChangeSetMappingProvider csmp = new ChangeSetMappingProvider(opts.ChangeSetMappingFile);
                csmp.ImportMappings(me.ChangeSetMapping);
            }

            Log.Information("Engine created, running...");
            me.Run();
        }