fix: init script + optimize laravel
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Actions\Server\StopSentinel;
|
|
||||||
use App\Enums\ActivityTypes;
|
use App\Enums\ActivityTypes;
|
||||||
use App\Enums\ApplicationDeploymentStatus;
|
use App\Enums\ApplicationDeploymentStatus;
|
||||||
use App\Models\ApplicationDeploymentQueue;
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
@@ -12,6 +11,7 @@ use App\Models\Server;
|
|||||||
use App\Models\StandalonePostgresql;
|
use App\Models\StandalonePostgresql;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Facades\File;
|
use Illuminate\Support\Facades\File;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
@@ -25,6 +25,8 @@ class Init extends Command
|
|||||||
|
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
|
$this->optimize();
|
||||||
|
|
||||||
if (isCloud() && ! $this->option('force-cloud')) {
|
if (isCloud() && ! $this->option('force-cloud')) {
|
||||||
echo "Skipping init as we are on cloud and --force-cloud option is not set\n";
|
echo "Skipping init as we are on cloud and --force-cloud option is not set\n";
|
||||||
|
|
||||||
@@ -39,7 +41,6 @@ class Init extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Backward compatibility
|
// Backward compatibility
|
||||||
// $this->disable_metrics();
|
|
||||||
$this->replace_slash_in_environment_name();
|
$this->replace_slash_in_environment_name();
|
||||||
$this->restore_coolify_db_backup();
|
$this->restore_coolify_db_backup();
|
||||||
$this->update_user_emails();
|
$this->update_user_emails();
|
||||||
@@ -95,19 +96,13 @@ class Init extends Command
|
|||||||
File::put(base_path('templates/service-templates.json'), json_encode($services));
|
File::put(base_path('templates/service-templates.json'), json_encode($services));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// private function disable_metrics()
|
|
||||||
// {
|
private function optimize()
|
||||||
// if (version_compare('4.0.0-beta.312', config('version'), '<=')) {
|
{
|
||||||
// foreach ($this->servers as $server) {
|
echo "Optimizing Laravel deployment.\n";
|
||||||
// if ($server->settings->is_metrics_enabled === true) {
|
Artisan::call('optimize:clear');
|
||||||
// $server->settings->update(['is_metrics_enabled' => false]);
|
Artisan::call('optimize');
|
||||||
// }
|
}
|
||||||
// if ($server->isFunctional()) {
|
|
||||||
// StopSentinel::dispatch($server)->onQueue('high');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
private function update_user_emails()
|
private function update_user_emails()
|
||||||
{
|
{
|
||||||
|
@@ -1,7 +1,3 @@
|
|||||||
#!/command/execlineb -P
|
#!/command/execlineb -P
|
||||||
s6-setuidgid webuser
|
s6-setuidgid webuser
|
||||||
foreground {
|
php /var/www/html/artisan app:init
|
||||||
php /var/www/html/artisan optimize:clear
|
|
||||||
php /var/www/html/artisan optimize
|
|
||||||
php /var/www/html/artisan app:init
|
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user