REBELinBLUE\Deployer\Console\Commands\UpdateApp::handle PHP Method

handle() public method

Execute the console command.
public handle ( ) : mixed
return mixed
    public function handle()
    {
        if (!$this->verifyInstalled() || $this->hasRunningDeployments() || $this->composerOutdated() || $this->nodeOutdated() || !$this->checkRequirements()) {
            return -1;
        }
        $bring_back_up = false;
        if (!App::isDownForMaintenance()) {
            $this->error(Lang::get('app.not_down'));
            if (!$this->confirm(Lang::get('app.switch_down'))) {
                return;
            }
            $bring_back_up = true;
            $this->call('down');
        }
        $this->backupDatabase();
        $this->updateConfiguration();
        $this->clearCaches();
        $this->migrate();
        $this->optimize();
        $this->restartQueue();
        $this->restartSocket();
        // If we prompted the user to bring the app down, bring it back up
        if ($bring_back_up) {
            $this->call('up');
        }
    }