Beispiel #1
0
 protected function applyToGitProjects($remote, \Closure $closure)
 {
     foreach ($this->codex->getProjects() as $project) {
         if ($project->config('enable_git_hook', false) === false || $project->config('git_hook_settings.webhook.enabled', false) === false) {
             continue;
         }
         $config = $project->config('git_hook_settings');
         $projectRepo = $project->config('git_hook_settings.owner') . '/' . $project->config('git_hook_settings.repository');
         $hook = call_user_func_array($closure, [$project]);
         if ($hook instanceof Response) {
             return $hook;
         }
         if ($hook['repository'] !== $projectRepo) {
             continue;
         }
         $this->factory->createSyncJob($project);
         $this->codex->log('info', 'codex.hooks.git.webhook.call', ['remote' => $remote]);
         return response('', 200);
     }
 }
 protected function applyToGitProjects($remote, \Closure $closure)
 {
     foreach ($this->codex->projects->all() as $project) {
         $name = $project->getName();
         $enabled = $project->hasEnabledHook('git');
         $webhook = $project->config('hooks.git.webhook.enabled', false);
         if (!$enabled || !$webhook) {
             continue;
         }
         $projectRepo = $project->config('hooks.git.owner') . '/' . $project->config('hooks.git.repository');
         $hook = call_user_func_array($closure, [$project]);
         if ($hook instanceof Response) {
             return $hook;
         }
         if ($hook !== $projectRepo) {
             continue;
         }
         $this->git->createSyncJob($project);
         $this->codex->log('info', 'codex.hooks.git.webhook.call', ['remote' => $remote]);
         return response('', 200);
     }
 }