new deployer command

This commit is contained in:
Mark Gregory
2026-09-16 11:41:15 +01:00
parent 8c0b214a9d
commit 744968120a
3 changed files with 23 additions and 21 deletions
+8 -8
View File
@@ -2,9 +2,9 @@
namespace App\Console\Commands;
use App\Exceptions\DatabaseStageException;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Process;
use RuntimeException;
class DatabaseStage extends Command
{
@@ -133,13 +133,13 @@ class DatabaseStage extends Command
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"pg_dump failed:\n" . $result->errorOutput(),
);
}
if (! file_exists($localDump) || filesize($localDump) === 0) {
throw new RuntimeException('Database dump was not created or is empty.');
throw new DatabaseStageException('Database dump was not created or is empty.');
}
return true;
@@ -166,7 +166,7 @@ class DatabaseStage extends Command
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"Invalid PostgreSQL archive:\n" . $result->errorOutput(),
);
}
@@ -193,7 +193,7 @@ class DatabaseStage extends Command
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"Upload failed:\n" . $result->errorOutput(),
);
}
@@ -252,7 +252,7 @@ SQL;
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"Unable to recreate stage database:\n" .
$result->errorOutput(),
);
@@ -299,7 +299,7 @@ SQL;
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"Database restore failed:\n" .
$result->errorOutput(),
);
@@ -345,7 +345,7 @@ SQL;
]);
if ($result->failed()) {
throw new RuntimeException(
throw new DatabaseStageException(
"Database verification failed:\n" .
$result->errorOutput(),
);