* Add pipeline data and apigetbranches model method

This commit is contained in:
zenggang
2021-12-09 06:57:48 +00:00
parent d03205740a
commit 6985783f0a
3 changed files with 67 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
title: zt_pipeline
author: Zeng gang
version: "1.0"
fields:
- field: id
range: 1
- field: type
range: gitlab
- field: name
range: gitlab服务器
- field: url
range: [http://192.168.1.161:51080]
- field: account
range: []
- field: password
range: []
- field: token
range: x88fZokrp5hShia2jyBN
- field: private
range: 08bcc98f75d7d40053dc80722bdc117b
- field: createdBy
range: admin
- field: createdDate
range: [2021-12-09 11:23:35]
- field: deleted
range: 0
+2
View File
@@ -29,3 +29,5 @@ $builder->projectProduct = array('rows' => 21, 'data' => array('projectproduct'
$builder->case = array('rows' => 10000, 'data' => array('case'));
$builder->bug = array('rows' => 100, 'data' => array('bug'));
$builder->pipeline = array('rows' => 1, 'data' => array('pipeline'));
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
/**
title=测试 gitlabModel::apiGetBranches();
cid=1
pid=1
通过gitlabID,projectID,获取GitLab分支列表 >> branch1
通过gitlabID,projectID,获取GitLab分支数量 >> 3
当前项目没有分支时,获取GitLab分支列表 >> 0
当gitlabID存在,projectID不存在时,获取GitLab分支列表 >> 404 Project Not Found
当gitlabID,projectID都为0时,获取GitLab分支列表 >> return empty
*/
$gitlab = $tester->loadModel('gitlab');
$gitlabID = 1;
$projectID = 1552;
$result = $gitlab->apiGetBranches($gitlabID, $projectID);
r($result) && p('0:name') && e('branch1'); //通过gitlabID,projectID,获取GitLab分支列表
r(count($result)) && p() && e(3); //通过gitlabID,projectID,获取GitLab分支数量
$gitlabID = 1;
$projectID = 1570;
r(count($gitlab->apiGetBranches($gitlabID, $projectID))) && p() && e(0); //当前项目没有分支时,获取GitLab分支列表
$gitlabID = 1;
$projectID = 0;
r($gitlab->apiGetBranches($gitlabID, $projectID)) && p('message') && e('404 Project Not Found'); //通过gitlabID,projectID,获取GitLab分支列表
$gitlabID = 0;
$projectID = 0;
$result = $gitlab->apiGetBranches($gitlabID, $projectID);
if(empty($result)) $result = 'return empty';
r($result) && p() && e('return empty'); //当gitlabID,projectID都为0时,获取GitLab分支列表