/**
  * Register system hooks on all the gitlab instances
  *
  * @return void
  */
 public function registerSystemHooksOnInstances()
 {
     /** @var \App\GitLab\GitLab $instance */
     foreach ($this->gitlab->getInstances() as $instance) {
         $instance->sendApiRequest('POST', 'hooks', ['url' => $this->getHookCatchUrlFromCli($instance->getHostId())]);
     }
 }
 /**
  * Update the env string with any new values
  * @param  string $envString environment to update
  * @return string
  */
 public function updateEnv($envString)
 {
     $envString = preg_replace('/GITLAB_.*\\n\\n?/', '', $envString);
     $instances = $this->gitlabManager->getInstances();
     $totalInstances = count($instances);
     for ($index = 0; $index < $totalInstances; $index++) {
         $gitlab = $instances[$index];
         $gitlabEnvString = $this->buildGitLabEnv($gitlab, $index);
         $envString .= $gitlabEnvString;
     }
     return $envString;
 }