From 6a03d21fefede2c192c1e3144abb93c6c00bd4e2 Mon Sep 17 00:00:00 2001 From: Sam Jordan Date: Mon, 18 May 2020 14:22:03 +0100 Subject: [PATCH] Provides real-time output for build and push commands --- app/Commands/DockerBuildCommand.php | 10 +++++----- app/Commands/DockerPushCommand.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/Commands/DockerBuildCommand.php b/app/Commands/DockerBuildCommand.php index 3bae595..a2815ac 100644 --- a/app/Commands/DockerBuildCommand.php +++ b/app/Commands/DockerBuildCommand.php @@ -103,18 +103,18 @@ protected function callBuild(string $tag, string $service = null): bool ], null, 1200); // 20min timeout $process->start(); + + foreach ($process as $data) { + echo $data; + } + $process->wait(); if ($process->getExitCode() !== 0) { - foreach ($process as $data) { - echo $data; - } - $this->error("Unable to push all items to AWS, check the above output for reasons why."); return false; } - echo $process->getOutput(); return true; } } diff --git a/app/Commands/DockerPushCommand.php b/app/Commands/DockerPushCommand.php index 1bc2d23..2bfa65b 100644 --- a/app/Commands/DockerPushCommand.php +++ b/app/Commands/DockerPushCommand.php @@ -103,18 +103,18 @@ protected function callPush(string $tag, string $service = null): bool ], null, 1200); // 20min timeout $process->start(); + + foreach ($process as $data) { + echo $data; + } + $process->wait(); if ($process->getExitCode() !== 0) { - foreach ($process as $data) { - echo $data; - } - $this->error("Unable to push all items to AWS, check the above output for reasons why."); return false; } - echo $process->getOutput(); return true; } }