示例#1
0
 public void ExecuteAndForget_EchoArgsToStdout_Test()
 {
     using (var cli = new Cli(_echoArgsToStdoutBat))
     {
         cli.ExecuteAndForget(TestString);
     }
 }
示例#2
0
        public void ExecuteAndForget_EchoStdin_Test()
        {
            var cli = new Cli(EchoStdinBat);

            var input = new ExecutionInput(standardInput: "Hello world");

            cli.ExecuteAndForget(input);
        }
示例#3
0
        public async Task RunCompose(string yaml)
        {
            File.WriteAllText(Path.Combine(_executionPath, "docker-compose.yml"), yaml);
            ExecutionInput input = new ExecutionInput($@"-p {_projectName} -f {_executionPath}\docker-compose.yml up");

            _cliCompose.ExecuteAndForget(input);

            await WaitForContainerToDie();

            ComposeDown();
        }
示例#4
0
        public static async Task Start(string companyName, MicroServiceEntity entity)
        {
            var projectName = Constants.appNamePrefix + entity.Name.Kebaberize();
            var projectPath = await GoFilePaths.GetProjectPath(companyName, entity.Name);

            await GoCommands.Build(projectPath);

            var buildPath = Path.Combine(projectPath, projectName + ".exe");

            var port        = MachinePorts.GetAvailablePort(3000);
            var runLocation = $"localhost:{port}";

            Console.WriteLine($"Attempting to run {entity.Name} at {runLocation}");

            using (var cli = new Cli(buildPath))
            {
                cli.ExecuteAndForget(runLocation);
                Console.WriteLine($"{entity.Name} running at {runLocation}");
            }
        }
示例#5
0
        public void ExecuteAndForget_ThrowError_Test()
        {
            var cli = new Cli(ThrowErrorBat);

            cli.ExecuteAndForget();
        }
示例#6
0
        public void ExecuteAndForget_EchoArgs_Test()
        {
            var cli = new Cli(EchoArgsBat);

            cli.ExecuteAndForget("Hello world");
        }