Commit eb72bb85 authored by 黎博's avatar 黎博

去掉新增测试流程里的一些后续处理操作

parent 76690761
......@@ -178,38 +178,38 @@ public class PipelineController {
}
pipelineService.saveBatch(pipelineList);
}
String dingUrl = dingRobot.getDingUrl();
Integer submitTestInstructionId = dingRobot.getSubmitTestInstructionId();
SubmitTestInstruction submitTestInstruction = submitTestInstructionService.getById(submitTestInstructionId);
// String dingUrl = dingRobot.getDingUrl();
// Integer submitTestInstructionId = dingRobot.getSubmitTestInstructionId();
// SubmitTestInstruction submitTestInstruction = submitTestInstructionService.getById(submitTestInstructionId);
// 提测说明不为空时
if (submitTestInstruction != null) {
// 开始循环执行SQL
String database = submitTestInstruction.getDatabase();
List<Map> databaseMapList = JSONArray.parseArray(database, Map.class);
String sqlExecUrl = qaPlatformHost + "/sql/execute";
Map<String, String> sqlExecParams = new HashMap<>();
sqlExecParams.put("namespace", dingRobot.getNamespace());
for (Map map: databaseMapList) {
String db = map.get("db").toString();
String sql = map.get("sql").toString();
sqlExecParams.put("database", db);
sqlExecParams.put("sql", sql);
sqlExecParams.put("type", sql.split(" ")[0]);
String response = HttpClientUtils.doGet(sqlExecUrl, sqlExecParams);
log.info("开始在数据库:{} 执行SQL: {}, 返回结果:{}", db, sql, response);
}
// if (submitTestInstruction != null) {
// // 开始循环执行SQL
// String database = submitTestInstruction.getDatabase();
// List<Map> databaseMapList = JSONArray.parseArray(database, Map.class);
// String sqlExecUrl = qaPlatformHost + "/sql/execute";
// Map<String, String> sqlExecParams = new HashMap<>();
// sqlExecParams.put("namespace", dingRobot.getNamespace());
// for (Map map: databaseMapList) {
// String db = map.get("db").toString();
// String sql = map.get("sql").toString();
// sqlExecParams.put("database", db);
// sqlExecParams.put("sql", sql);
// sqlExecParams.put("type", sql.split(" ")[0]);
// String response = HttpClientUtils.doGet(sqlExecUrl, sqlExecParams);
// log.info("开始在数据库:{} 执行SQL: {}, 返回结果:{}", db, sql, response);
// }
// 开始循环部署项目
for (Pipeline pipeline: pipelineList) {
log.info("首次创建提测说明,部署项目:{}, 分支:{}, 项目类型:{}, Namespace:{}", pipeline.getServiceName(),
pipeline.getServiceBranch(), pipeline.getServiceType(), pipeline.getNamespace());
jenkinsService.buildTkeJob(pipeline.getServiceType(), pipeline.getServiceName(), pipeline.getServiceBranch(), pipeline.getNamespace());
}
// for (Pipeline pipeline: pipelineList) {
// log.info("首次创建提测说明,部署项目:{}, 分支:{}, 项目类型:{}, Namespace:{}", pipeline.getServiceName(),
// pipeline.getServiceBranch(), pipeline.getServiceType(), pipeline.getNamespace());
// jenkinsService.buildTkeJob(pipeline.getServiceType(), pipeline.getServiceName(), pipeline.getServiceBranch(), pipeline.getNamespace());
// }
String submitTestUrl = qaPlatformUiHost + "/qa/detailTestDescription?projectName=" + projectName + "&jiraProjectKey=" + jiraProjectKey;
String msg = DingdingUtils.buildTestSubmitInstructionMsg(projectName, submitTestUrl);
boolean sendToDingResult = DingdingUtils.sendToDingding(msg, testDescDingUrl);
log.info("创建测试流程时,发送给数据组的通知结果:" + sendToDingResult);
}
// String submitTestUrl = qaPlatformUiHost + "/qa/detailTestDescription?projectName=" + projectName + "&jiraProjectKey=" + jiraProjectKey;
// String msg = DingdingUtils.buildTestSubmitInstructionMsg(projectName, submitTestUrl);
// boolean sendToDingResult = DingdingUtils.sendToDingding(msg, testDescDingUrl);
// log.info("创建测试流程时,发送给数据组的通知结果:" + sendToDingResult);
// }
log.info("新增dingRobot以及对应pipeline成功: {}", dingRobotPipelineVo);
return JsonResult.buildSuccessResult(true);
} catch (Exception e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment