Merge branch 'jihu' of https://gitlab.zcorp.cc/easycorp/zentaopms into jihu
This commit is contained in:
@@ -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>";
|
||||
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user