remove: all deploy UI/backend code, keep _deploy folder only
- Delete DeployRunCommand, DeployController, deploy API routes - Delete Dashboard/Deploy Vue pages and components - Remove deploy route from web.php - Remove deploy quick action from config - Remove DeployRunCommand from ConsoleKernel
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\UI\API\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Process;
|
||||
|
||||
class DeployController extends Controller
|
||||
{
|
||||
private string $statusFile = '/tmp/deploy-status.json';
|
||||
private string $lockFile = '/tmp/deploy.lock';
|
||||
|
||||
public function store(): JsonResponse
|
||||
{
|
||||
if (File::exists($this->lockFile)) {
|
||||
return response()->json([
|
||||
'error' => 'Deploy already in progress'
|
||||
], 409);
|
||||
}
|
||||
|
||||
Process::run('nohup php artisan deploy:run > /dev/null 2>&1 &');
|
||||
|
||||
return response()->json(['message' => 'Deploy started']);
|
||||
}
|
||||
|
||||
public function status(): JsonResponse
|
||||
{
|
||||
if (!File::exists($this->statusFile)) {
|
||||
return response()->json([
|
||||
'running' => false,
|
||||
'step' => 0,
|
||||
'total_steps' => 12,
|
||||
'current_step' => '',
|
||||
'logs' => [],
|
||||
'error' => null,
|
||||
]);
|
||||
}
|
||||
|
||||
$status = json_decode(File::get($this->statusFile), true);
|
||||
return response()->json($status);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
use App\Containers\Dashboard\UI\API\Controllers\DeployController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::middleware([
|
||||
\App\Ship\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\App\Ship\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'superadmin',
|
||||
])->group(function () {
|
||||
Route::post('/deploy', [DeployController::class, 'store']);
|
||||
Route::get('/deploy/status', [DeployController::class, 'status']);
|
||||
});
|
||||
@@ -416,11 +416,6 @@ Route::middleware(['access-check', 'dashboard.auth'])->group(function () {
|
||||
Route::put('/{credential}', [IntegrationCredentialsController::class, 'update'])->name('update');
|
||||
Route::delete('/{credential}', [IntegrationCredentialsController::class, 'destroy'])->name('destroy');
|
||||
});
|
||||
|
||||
// Deploy
|
||||
Route::get('/dashboard/deploy', function () {
|
||||
return inertia()->render('Dashboard/Deploy/Index');
|
||||
})->name('dashboard.deploy');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user