* Correct codes in job and compile module.

This commit is contained in:
dingguodong
2021-10-29 17:33:13 +08:00
parent f3b6a38403
commit ff55234a7b
3 changed files with 6 additions and 5 deletions

View File

@@ -134,7 +134,7 @@ class compileModel extends model
if($job->triggerType == 'tag')
{
$lastTag = $this->getLastTagByRepo($repo);
$lastTag = $this->loadModel('job')->getLastTagByRepo($repo);
if($lastTag)
{
$job->lastTag = $lastTag;

View File

@@ -352,7 +352,7 @@ class job extends control
if($productLeft == $productRight) $matchedProducts[$productName] = $productRight;
}
}
die(json_encode($matchedProduct));
die(json_encode($matchedProducts));
}
$productName = $this->loadModel('product')->getByID($repo->product)->name;

View File

@@ -364,7 +364,7 @@ class jobModel extends model
if($job->triggerType == 'tag')
{
$lastTag = $this->getLastTagByRepo($repo);
$lastTag = $this->getLastTagByRepo($repo, $job);
if($lastTag)
{
$build->tag = $lastTag;
@@ -430,7 +430,7 @@ class jobModel extends model
/**
* Exec gitlab pipeline.
*
* @param int $job
* @param object $job
* @access public
* @return void
*/
@@ -473,10 +473,11 @@ class jobModel extends model
* Get last tag of one repo.
*
* @param object $repo
* @param object $job
* @access public
* @return void
*/
public function getLastTagByRepo($repo)
public function getLastTagByRepo($repo, $job)
{
if($repo->SCM == 'Subversion')
{