Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/Commands/DeploymentsLogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ protected function show(InputInterface $input, OutputInterface $output): int
foreach ($logs as $log) {
$output->writeln($log['line'], OutputInterface::OUTPUT_RAW);
}
$summary = "Deployment #$id: {$deployment['message']}";
$stderr = $this->stderr($output);
$stderr->writeln("Deployment #$id: {$deployment['message']}", OutputInterface::OUTPUT_RAW);
// On its own lines, as `bref deploy` shows it: it can span several lines, and ends with a hint for known errors
if ($deployment['error_message']) {
$summary .= " ({$deployment['error_message']})";
$stderr->writeln(['', $deployment['error_message']], OutputInterface::OUTPUT_RAW);
}
$this->stderr($output)->writeln($summary, OutputInterface::OUTPUT_RAW);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Commands/DeploymentsLogsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ public function test_agents_get_the_logs_as_text_without_colors(): void

$this->assertSame(0, $tester->getStatusCode(), $tester->getDisplay());
$this->assertSame("✔ Packaged\nUPDATE_FAILED AWS::Lambda::Function\n", $tester->getDisplay());
$this->assertSame("Deployment #25: failed (The CloudFormation stack failed to update)\n", $tester->getErrorOutput());
$this->assertSame("Deployment #25: failed\n\nThe CloudFormation stack failed to update\n", $tester->getErrorOutput());
}
}
Loading