This commit is contained in:
Guan Xiying
2021-06-18 10:22:04 +08:00
3 changed files with 20 additions and 0 deletions
+2
View File
@@ -17,5 +17,7 @@ $config->gitlab->bugLabel->description = "bug label from zentao";
$config->gitlab->bugLabel->color = "#D10069";
$config->gitlab->bugLabel->priority = "0";
$config->gitlab->zentaoApiWebhookUrl = "https://zentao/api/v1/webhook/callback";
$config->gitlab->zentaoApiWebhookToken = "<access token>";
+15
View File
@@ -227,6 +227,21 @@ class gitlabModel extends model
return $gitlab_url;
}
/**
* Create webhook for zentao.
*
* @param int $gitlabID
* @param int $projectID
* @access public
* @return void
*/
public function createWebhook($gitlabID, $projectID)
{
// TODO(dingguodong) add more robust code here.
$response = $this->apiCreateHook($gitlabID, $projectID, $this->config->gitlab->zentaoApiWebhookUrl, $this->config->gitlab->zentaoApiWebhookToken);
return $response;
}
/**
* Get hooks.
*
+3
View File
@@ -235,6 +235,9 @@ class repoModel extends model
// save the relationship between zentao product and gitlab project to zt_relation table.
/* create webhook for zentao */
$this->loadModel("gitlab")->createWebhook($this->post->gitlabHost, $this->post->gitlabProject);
}