2023-03-17 14:33:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2023-05-03 05:15:45 +00:00
|
|
|
use App\Jobs\HandleCoolifyTaskInQueue;
|
2023-03-30 07:47:04 +00:00
|
|
|
use Illuminate\Queue\Events\JobProcessed;
|
2023-04-14 08:00:42 +00:00
|
|
|
use Illuminate\Support\Facades\Process;
|
2023-03-30 07:47:04 +00:00
|
|
|
use Illuminate\Support\Facades\Queue;
|
2023-03-17 14:33:48 +00:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*/
|
|
|
|
public function register(): void
|
|
|
|
{
|
2023-04-14 08:00:42 +00:00
|
|
|
// @TODO: Is this the best place to run the seeder?
|
|
|
|
// if (env('APP_ENV') === 'production') {
|
|
|
|
// dump('Seed default data.');
|
|
|
|
// Process::run('php artisan db:seed --class=ProductionSeeder --force');
|
|
|
|
// } else {
|
|
|
|
// dump('Not in production environment.');
|
|
|
|
// }
|
2023-03-17 14:33:48 +00:00
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
|
|
|
*/
|
|
|
|
public function boot(): void
|
|
|
|
{
|
2023-03-30 09:09:39 +00:00
|
|
|
Queue::after(function (JobProcessed $event) {
|
|
|
|
// @TODO: Remove `coolify-builder` container after the remoteProcess job is finishged and remoteProcess->type == `deployment`.
|
2023-05-03 05:15:45 +00:00
|
|
|
if ($event->job->resolveName() === HandleCoolifyTaskInQueue::class) {
|
2023-03-30 09:09:39 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
});
|
2023-03-17 14:33:48 +00:00
|
|
|
}
|
|
|
|
}
|