mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 14:06:15 +00:00
load AWS regions and plans dynamically via SDK (#366)
This commit is contained in:
@ -15,7 +15,6 @@
|
||||
use Exception;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\Rule;
|
||||
@ -45,7 +44,6 @@ public function create(User $creator, Project $project, array $input): Server
|
||||
'progress_step' => 'Initializing',
|
||||
]);
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
if ($server->provider != 'custom') {
|
||||
$server->provider_id = $input['server_provider'];
|
||||
@ -70,12 +68,10 @@ public function create(User $creator, Project $project, array $input): Server
|
||||
// install server
|
||||
$this->install($server);
|
||||
|
||||
DB::commit();
|
||||
|
||||
return $server;
|
||||
} catch (Exception $e) {
|
||||
$server->provider()->delete();
|
||||
DB::rollBack();
|
||||
$server->delete();
|
||||
|
||||
throw ValidationException::withMessages([
|
||||
'provider' => $e->getMessage(),
|
||||
]);
|
||||
|
Reference in New Issue
Block a user