/** * Handle the event. * * @param Event $event */ public function handle(Event $event) { $event->site->updateStatus('Adding mysql database'); $sql = 'CREATE DATABASE IF NOT EXISTS ' . Str::snake($event->site->name) . ';'; $this->envoy->run('mysql --sql="' . $sql . '"', true); $this->envoy->run('artisan --path="' . $event->site->rootPath . '" --cmd="migrate"', true); }
/** * @param Event $event */ public function handle(Event $event) { $event->site->updateStatus('Running the installer'); $installerType = $event->request['installType'] == 'base' ? null : '"--' . $event->request['installType'] . '"'; $group = $this->group->find($event->request['group_id']); $sitePath = Str::camel($event->request['name']); $this->envoy->run('make-site --path="' . $group->starting_path . '" --name="' . $sitePath . '" --type=' . $installerType, true); }
/** * @param Event $event */ public function handle(Event $event) { $cloneModel = $this->clone->find($event->request['clone_id']); $group = $this->group->find($event->request['group_id']); $sitePath = Str::camel($event->request['name']); $event->site->updateStatus('Cloning the repo'); $this->envoy->run('clone --path="' . $group->starting_path . '" --name="' . $sitePath . '" --url=' . $cloneModel->url, true); }
/** * Handle the event. * * @param Event $event */ public function handle(Event $event) { $event->site->updateStatus('Running composer install'); $this->envoy->run('composer --path="' . $event->site->rootPath . '" --cmd=install', true); }
/** * Handle the event. * * @param Event $event */ public function handle(Event $event) { $event->site->updateStatus('Generating key'); $this->envoy->run('artisan --path="' . $event->site->rootPath . '" --cmd="key:generate"', true); }
protected function reloadNginx($site) { $site->updateStatus('Reloading nginx'); $this->envoy->run('nginx --cmd="reload"'); }
protected function provisionVagrant($site) { $site->updateStatus('Re-provisioning vagrant box'); $this->envoy->run('vagrant --cmd="provision" --path="' . setting('homestead') . '"'); }