Esempio n. 1
0
        private static Command RunCommand(string[] args)
        {
            var command = new Command("run", "run the application")
            {
            };

            var argument = new Argument("manifest")
            {
                Description = "A directory with a manifest or a manifest",
                Arity       = ArgumentArity.ZeroOrOne
            };

            command.AddOption(new Option("--port")
            {
                Description = "Port to run the run control plane on",
                Argument    = new Argument <int>("port"),
                Required    = false
            });


            command.AddOption(new Option("--debug")
            {
                Required = false
            });

            command.AddArgument(argument);

            command.Handler = CommandHandler.Create <IConsole, string>((console, manifest) =>
            {
                Application app = ResolveApplication(manifest);
                return(MicronetesHost.RunAsync(app, args));
            });

            return(command);
        }
Esempio n. 2
0
        private static Command RunCommand(string[] args)
        {
            var command = new Command("run", "run the application")
            {
            };

            var argument = new Argument("path")
            {
                Description = "A file or directory to execute. Supports a project files, solution files or a yaml manifest.",
                Arity       = ArgumentArity.ZeroOrOne
            };

            // TODO: We'll need to support a --build-args
            command.AddOption(new Option("--no-build")
            {
                Description = "Do not build project files before running.",
                Required    = false
            });

            command.AddOption(new Option("--port")
            {
                Description = "The port to run control plane on.",
                Argument    = new Argument <int>("port"),
                Required    = false
            });

            command.AddOption(new Option("--logs")
            {
                Description = "Write structured application logs to the specified log providers. Supported providers are console, elastic (Elasticsearch), ai (ApplicationInsights), seq.",
                Argument    = new Argument <string>("logs"),
                Required    = false
            });

            command.AddOption(new Option("--dtrace")
            {
                Description = "Write distributed traces to the specified providers. Supported providers are zipkin.",
                Argument    = new Argument <string>("logs"),
                Required    = false
            });

            command.AddOption(new Option("--debug")
            {
                Description = "Wait for debugger attach in all services.",
                Required    = false
            });

            command.AddArgument(argument);

            command.Handler = CommandHandler.Create <IConsole, string>((console, path) =>
            {
                Application app = ResolveApplication(path);
                return(MicronetesHost.RunAsync(app, args));
            });

            return(command);
        }
Esempio n. 3
0
        private static Command RunCommand(string[] args)
        {
            var command = new Command("run", "run the application")
            {
            };

            var argument = new Argument("path")
            {
                Description = "A file or directory to execute. Supports a project files, solution files or a yaml manifest.",
                Arity       = ArgumentArity.ZeroOrOne
            };

            command.AddOption(new Option("--port")
            {
                Description = "The port to run control plane on.",
                Argument    = new Argument <int>("port"),
                Required    = false
            });

            command.AddOption(new Option("--elastic")
            {
                Description = "Elasticsearch URL. Write structured application logs to Elasticsearch.",
                Argument    = new Argument <string>("elastic"),
                Required    = false
            });

            command.AddOption(new Option("--appinsights")
            {
                Description = "ApplicationInsights instrumentation key. Write structured application logs to ApplicationInsights.",
                Argument    = new Argument <string>("instrumenation-key"),
                Required    = false
            });

            command.AddOption(new Option("--debug")
            {
                Description = "Wait for debugger attach in all services.",
                Required    = false
            });

            command.AddArgument(argument);

            command.Handler = CommandHandler.Create <IConsole, string>((console, path) =>
            {
                Application app = ResolveApplication(path);
                return(MicronetesHost.RunAsync(app, args));
            });

            return(command);
        }
Esempio n. 4
0
 public static async Task Main(string[] args)
 {
     var application = Application.FromYaml("../m8s.yaml");
     await MicronetesHost.RunAsync(application, args);
 }