From 21c9ee13bc4a5729c259ec2c2f34ca22ebc79e09 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Thu, 22 Jul 2021 09:27:24 +0800 Subject: [PATCH] + Add ajaxc getting gitlab project pipeline. --- module/gitlab/control.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/module/gitlab/control.php b/module/gitlab/control.php index b672824ba6..c70fcfeaca 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -337,7 +337,7 @@ class gitlab extends control public function ajaxGetExecutionsByProduct($productID) { if(!$productID) return $this->send(array('message' => array())); - + $executions = $this->loadModel('product')->getAllExecutionPairsByProduct($productID); $options = ""; foreach($executions as $index =>$execution) @@ -346,4 +346,24 @@ class gitlab extends control } die($options); } + + /** + * AJAX: Get gitlab project pipeline. + * + * @param int $repoID + * @access public + * @return void + */ + public function ajaxGetPipeline($repoID) + { + if(empty($repoID)) die(json_encode(array('' => ''))); + $this->loadModel('repo'); + $repo = $this->repo->getRepoByID($repoID); + if(empty($repo)) die(json_encode(array('' => ''))); + + $gitlabID = $repo->gitlab; + $projectID = $repo->projectID; + $pipeline = $this->gitlab->getPipeline($gitlabID, $projectID); + die(json_encode($pipeline)); + } }