Skip to content

Commit

Permalink
Fixes logic issues that caused builds to return a code of 0 when they…
Browse files Browse the repository at this point in the history
… actually failed
  • Loading branch information
spamoom committed Oct 29, 2021
1 parent 78de9ce commit 96aae8a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/Commands/DockerBuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ public function handle()
$this->line("Building docker images for all services with tag {$tag}");
if ($this->callBuild($tag)) {
return $this->info("Docker images built.");
} else {
$this->error("Docker images failed to build.");
return 1;
}
}

Expand Down
7 changes: 5 additions & 2 deletions app/Commands/DockerPushCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ public function handle()
if (count($services) == 0) {
// Generic full file build as we have no services
$this->line("Pushing docker images for all services with tags " . implode(', ', $tags));
$this->callPush($tags);
if (!$this->callPush($tags)) {
$this->error("Unable to push images.");
return 1;
}
} else {
// We've been provided services, we'll run the command for each
$this->line(sprintf(
Expand All @@ -89,7 +92,7 @@ protected function callPush(array $tags, string $service = null): bool
// We need to make the new tags first
$sourceTag = $this->helpers->docker()->prefixedTag();
if (!$this->helpers->docker()->tagImages($service, $sourceTag, $tags)) {
return 1;
return false;
}

foreach ($tags as $tag) {
Expand Down

0 comments on commit 96aae8a

Please sign in to comment.