new deployer command
This commit is contained in:
@@ -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(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user