Files
ABSDEV/Modules/CloudDevOps/Console/Commands/CloudDevOpsPruneCommand.php
T
Mark Gregory bc9427ac33 Deployment environments
* Development, staging, and production environment types
* Protected-environment support
* Deployment targets
* Local, SSH, Docker, and Kubernetes driver foundation
* Deployment pipelines
* Configurable pipeline steps
* Manual and approval-based releases
* Deployment release history
* Individual deployment-step tracking
* HTTP health checks
* Response-time tracking
* Rollback records
* Secret-reference metadata
* Encrypted target configuration
* Encrypted environment variables
* Administration dashboard
* Authenticated API endpoints
* Health-check command
* Release-history pruning command
* Permissions
* Sidebar integration
* Module registration
* Feature test
2026-07-24 13:57:56 +01:00

6 lines
622 B
PHP

<?php
namespace Modules\CloudDevOps\Console\Commands;
use Illuminate\Console\Command;
use Modules\CloudDevOps\Models\DeploymentRelease;
final class CloudDevOpsPruneCommand extends Command { protected $signature='cloud-devops:prune {--days=}'; protected $description='Prune old deployment release history'; public function handle(): int { $days=(int)($this->option('days') ?: config('clouddevops.retention_days',90)); $count=DeploymentRelease::where('created_at','<',now()->subDays($days))->whereIn('status',['succeeded','failed','cancelled'])->delete(); $this->info("Pruned {$count} releases."); return self::SUCCESS; } }