/** * @param Jenkins_JobQueue $queue * * @throws RuntimeException * @return void */ public function cancelQueue(Jenkins_JobQueue $queue) { $url = sprintf('%s/queue/item/%s/cancelQueue', $this->baseUrl, $queue->getId()); $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, 1); curl_exec($curl); if (curl_errno($curl)) { throw new RuntimeException(sprintf('Error durring stopping job queue #%s', $queue->getId())); } }
/** * @param Jenkins_JobQueue $queue * * @throws RuntimeException * @return void */ public function cancelQueue(Jenkins_JobQueue $queue) { $url = sprintf('%s/queue/item/%s/cancelQueue', $this->baseUrl, $queue->getId()); $curl = curl_init($url); curl_setopt($curl, CURLOPT_POST, 1); $headers = array(); if ($this->areCrumbsEnabled()) { $headers[] = $this->getCrumbHeader(); } curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_exec($curl); if (curl_errno($curl)) { throw new RuntimeException(sprintf('Error durring stopping job queue #%s', $queue->getId())); } }
/** * @param \Jenkins_JobQueue $queue * * @return boolean */ public function isRelatedToJenkinsJobQueue(Jenkins_JobQueue $queue) { if ($queue->getJobName() != $this->getJobName()) { return false; } return $this->checkRelationWithParameters($queue->getInputParameters()); }