ignore to exec jenkins job if not exist

This commit is contained in:
aaronchen2k
2020-02-04 22:39:50 +08:00
parent 038dc34c3b
commit 543ca29c73
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -158,8 +158,9 @@ class ci extends control
*/
public function exeJob($id)
{
$this->ci->exeJob($id);
$result = $this->ci->exeJob($id);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
if(!$result) $this->send(array('result' => 'fail', 'message' => 'not found'));
$this->send(array('result' => 'success'));
}
+4
View File
@@ -184,6 +184,10 @@ class ciModel extends model
->where('job.id')->eq($jobID)
->fetch();
if (!$po) {
return false;
}
$jenkinsServer = $po->serviceUrl;
$jenkinsUser = $po->account;
$jenkinsTokenOrPassword = $po->token ? $po->token : base64_decode($po->password);