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

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

            cli.ExecuteAndForget(input);
        }
Beispiel #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();
        }
Beispiel #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}");
            }
        }
Beispiel #5
0
        public void ExecuteAndForget_ThrowError_Test()
        {
            var cli = new Cli(ThrowErrorBat);

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

            cli.ExecuteAndForget("Hello world");
        }