Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
holmes
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
holmes
Commits
eb72bb85
Commit
eb72bb85
authored
Jul 12, 2022
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去掉新增测试流程里的一些后续处理操作
parent
76690761
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
PipelineController.java
...va/cn/qg/holmes/controller/gitlab/PipelineController.java
+29
-29
No files found.
src/main/java/cn/qg/holmes/controller/gitlab/PipelineController.java
View file @
eb72bb85
...
@@ -178,38 +178,38 @@ public class PipelineController {
...
@@ -178,38 +178,38 @@ public class PipelineController {
}
}
pipelineService
.
saveBatch
(
pipelineList
);
pipelineService
.
saveBatch
(
pipelineList
);
}
}
String
dingUrl
=
dingRobot
.
getDingUrl
();
//
String dingUrl = dingRobot.getDingUrl();
Integer
submitTestInstructionId
=
dingRobot
.
getSubmitTestInstructionId
();
//
Integer submitTestInstructionId = dingRobot.getSubmitTestInstructionId();
SubmitTestInstruction
submitTestInstruction
=
submitTestInstructionService
.
getById
(
submitTestInstructionId
);
//
SubmitTestInstruction submitTestInstruction = submitTestInstructionService.getById(submitTestInstructionId);
// 提测说明不为空时
// 提测说明不为空时
if
(
submitTestInstruction
!=
null
)
{
//
if (submitTestInstruction != null) {
// 开始循环执行SQL
//
// 开始循环执行SQL
String
database
=
submitTestInstruction
.
getDatabase
();
//
String database = submitTestInstruction.getDatabase();
List
<
Map
>
databaseMapList
=
JSONArray
.
parseArray
(
database
,
Map
.
class
);
//
List<Map> databaseMapList = JSONArray.parseArray(database, Map.class);
String
sqlExecUrl
=
qaPlatformHost
+
"/sql/execute"
;
//
String sqlExecUrl = qaPlatformHost + "/sql/execute";
Map
<
String
,
String
>
sqlExecParams
=
new
HashMap
<>();
//
Map<String, String> sqlExecParams = new HashMap<>();
sqlExecParams
.
put
(
"namespace"
,
dingRobot
.
getNamespace
());
//
sqlExecParams.put("namespace", dingRobot.getNamespace());
for
(
Map
map:
databaseMapList
)
{
//
for (Map map: databaseMapList) {
String
db
=
map
.
get
(
"db"
).
toString
();
//
String db = map.get("db").toString();
String
sql
=
map
.
get
(
"sql"
).
toString
();
//
String sql = map.get("sql").toString();
sqlExecParams
.
put
(
"database"
,
db
);
//
sqlExecParams.put("database", db);
sqlExecParams
.
put
(
"sql"
,
sql
);
//
sqlExecParams.put("sql", sql);
sqlExecParams
.
put
(
"type"
,
sql
.
split
(
" "
)[
0
]);
//
sqlExecParams.put("type", sql.split(" ")[0]);
String
response
=
HttpClientUtils
.
doGet
(
sqlExecUrl
,
sqlExecParams
);
//
String response = HttpClientUtils.doGet(sqlExecUrl, sqlExecParams);
log
.
info
(
"开始在数据库:{} 执行SQL: {}, 返回结果:{}"
,
db
,
sql
,
response
);
//
log.info("开始在数据库:{} 执行SQL: {}, 返回结果:{}", db, sql, response);
}
//
}
// 开始循环部署项目
// 开始循环部署项目
for
(
Pipeline
pipeline:
pipelineList
)
{
//
for (Pipeline pipeline: pipelineList) {
log
.
info
(
"首次创建提测说明,部署项目:{}, 分支:{}, 项目类型:{}, Namespace:{}"
,
pipeline
.
getServiceName
(),
//
log.info("首次创建提测说明,部署项目:{}, 分支:{}, 项目类型:{}, Namespace:{}", pipeline.getServiceName(),
pipeline
.
getServiceBranch
(),
pipeline
.
getServiceType
(),
pipeline
.
getNamespace
());
//
pipeline.getServiceBranch(), pipeline.getServiceType(), pipeline.getNamespace());
jenkinsService
.
buildTkeJob
(
pipeline
.
getServiceType
(),
pipeline
.
getServiceName
(),
pipeline
.
getServiceBranch
(),
pipeline
.
getNamespace
());
//
jenkinsService.buildTkeJob(pipeline.getServiceType(), pipeline.getServiceName(), pipeline.getServiceBranch(), pipeline.getNamespace());
}
//
}
String
submitTestUrl
=
qaPlatformUiHost
+
"/qa/detailTestDescription?projectName="
+
projectName
+
"&jiraProjectKey="
+
jiraProjectKey
;
//
String submitTestUrl = qaPlatformUiHost + "/qa/detailTestDescription?projectName=" + projectName + "&jiraProjectKey=" + jiraProjectKey;
String
msg
=
DingdingUtils
.
buildTestSubmitInstructionMsg
(
projectName
,
submitTestUrl
);
//
String msg = DingdingUtils.buildTestSubmitInstructionMsg(projectName, submitTestUrl);
boolean
sendToDingResult
=
DingdingUtils
.
sendToDingding
(
msg
,
testDescDingUrl
);
//
boolean sendToDingResult = DingdingUtils.sendToDingding(msg, testDescDingUrl);
log
.
info
(
"创建测试流程时,发送给数据组的通知结果:"
+
sendToDingResult
);
//
log.info("创建测试流程时,发送给数据组的通知结果:" + sendToDingResult);
}
//
}
log
.
info
(
"新增dingRobot以及对应pipeline成功: {}"
,
dingRobotPipelineVo
);
log
.
info
(
"新增dingRobot以及对应pipeline成功: {}"
,
dingRobotPipelineVo
);
return
JsonResult
.
buildSuccessResult
(
true
);
return
JsonResult
.
buildSuccessResult
(
true
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment