Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            //设置读取指定位置的nlog.config文件
            if (RuntimeEnvironment.IsWindows)
            {
                NLogBuilder.ConfigureNLog("nlog-windows.config");
            }
            else
            {
                NLogBuilder.ConfigureNLog("nlog-linux.config");
            }

            var host = CreateHostBuilder(args).Build();
            var map  = GetArgsMap(args);

            DeployService deployService = new DeployService(host);

            if (map.Keys.Contains("m"))
            {
                var cmd = map["m"];

                switch (cmd)
                {
                case "GenSecret":
                    //deployService.InitSecret();
                    return;

                case "MigrateDatabase":
                    deployService.MigrateDatabase();

                    return;

                default:
                    Console.WriteLine("unkown cmd");
                    return;
                }
            }

            host.Run();
        }