Separating Migration into its own project (#1828)

* Moving Migration service to its own project

* Adding loc files to the project

* Adding Migration to build

* Adding Migration Integration Tests

* Trying loops

* Fixing params

* Fixing indent

* Cleaning up yaml

* Getting command line arg for auto flush log

* Adding tde service
This commit is contained in:
Aasim Khan
2023-01-30 10:30:28 -08:00
committed by GitHub
parent 82171740bc
commit ab5a1e6c85
38 changed files with 6163 additions and 64 deletions

View File

@@ -0,0 +1,64 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System;
using System.IO;
using System.Diagnostics;
using Microsoft.SqlTools.Extensibility;
using Microsoft.SqlTools.Utility;
namespace Microsoft.SqlTools.Migration
{
internal class Program
{
private const string ServiceName = "MicrosoftSqlToolsMigration.exe";
internal static void Main(string[] args)
{
try
{
CommandOptions commandOptions = new CommandOptions(args, ServiceName);
if (commandOptions.ShouldExit)
{
return;
}
string logFilePath = "MicrosoftSqlToolsMigration";
if (!string.IsNullOrWhiteSpace(commandOptions.LogFilePath))
{
logFilePath = Path.Combine(commandOptions.LogFilePath, logFilePath);
}
else
{
logFilePath = Logger.GenerateLogFilePath(logFilePath);
}
Logger.Initialize(SourceLevels.Verbose, logFilePath, "Migration", commandOptions.AutoFlushLog);
Logger.Verbose("Starting SqlTools Migration Server...");
ExtensionServiceHost serviceHost = new ExtensionServiceHost(
new ExtensibleServiceHostOptions
{
HostName = "Migration",
HostProfileId = "SqlTools.Migration",
HostVersion = new Version(1, 0, 0, 0),
InitializeServiceCallback = (server, serivce) => { }
});
serviceHost.RegisterAndInitializeService(new MigrationService());
serviceHost.WaitForExit();
Logger.Verbose("SqlTools Migration Server exiting....");
}
catch (Exception ex)
{
Logger.Error(ex);
throw ex;
}
}
}
}