* Add Sync MR from GitLab API to Zentao database, default time 5 minutes to execute once.

This commit is contained in:
lichengjun
2021-08-30 06:52:02 +00:00
parent 1b73c952ec
commit 8f4cfb67da
3 changed files with 23 additions and 0 deletions
+3
View File
@@ -1 +1,4 @@
ALTER TABLE `zt_testtask` ADD `realFinishedDate` datetime NOT NULL AFTER `end`;
INSERT INTO `zt_cron` (`m`, `h`, `dom`, `mon`, `dow`, `command`, `remark`, `type`, `buildin`, `status`, `lastTime`) VALUES
('*/5', '*', '*', '*', '*', 'moduleName=mr&methodName=syncMR', '定时同步GitLab合并数据到禅道数据库', 'zentao', 1, 'normal', '0000-00-00 00:00:00');
+1
View File
@@ -169,6 +169,7 @@ $lang->install->cronList['moduleName=todo&methodName=createCycle'] = '生
$lang->install->cronList['moduleName=ci&methodName=initQueue'] = '创建周期性任务';
$lang->install->cronList['moduleName=ci&methodName=checkCompileStatus'] = '同步Jenkins任务状态';
$lang->install->cronList['moduleName=ci&methodName=exec'] = '执行Jenkins任务';
$lang->install->cronList['moduleName=mr&methodName=syncMR'] = '定时同步GitLabMR信息';
$lang->install->success = "安装成功";
$lang->install->login = '登录禅道管理系统';
+19
View File
@@ -131,6 +131,25 @@ class mr extends control
$this->display();
}
/**
* Crontab sync MR from GitLab API to Zentao database, default time 5 minutes to execute once.
*
* @access public
* @return void
*/
public function syncMR()
{
$this->mr->getList();
if(dao::isError())
{
echo json_encode(dao::getError());
return true;
}
echo 'success';
}
/**
* AJAX: Get MR target projects.
*