Merge branch 'master' of http://1.14.125.6:3000/mianbin/ops-pro
This commit is contained in:
commit
80b9d2ed99
@ -2,13 +2,11 @@ package cd.casic.ci.process.engine.worker;
|
||||
|
||||
|
||||
import cd.casic.ci.process.common.WorkAtom;
|
||||
import cd.casic.ci.process.engine.constant.EngineRuntimeConstant;
|
||||
import cd.casic.ci.process.engine.context.ConstantContextHolder;
|
||||
import cd.casic.ci.process.engine.runContext.BaseRunContext;
|
||||
import cd.casic.ci.process.engine.runContext.TaskRunContext;
|
||||
import cd.casic.ci.process.engine.worker.base.HttpWorker;
|
||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||
import cd.casic.ci.process.process.dataObject.log.PipTaskLog;
|
||||
import cd.casic.ci.process.process.dataObject.pipeline.PipPipeline;
|
||||
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
@ -126,6 +124,7 @@ public class ApplicationWorker extends HttpWorker {
|
||||
|
||||
pollTaskStatus(restTemplate, scaTaskId);
|
||||
} else if (message.equals("应用已经存在")) {
|
||||
append(context,message);
|
||||
Integer oldScaTaskId = (Integer) applicationConfigInfo.get("taskId");
|
||||
Integer oldApplicationId = (Integer) applicationConfigInfo.get("applicationId");
|
||||
int restartResult = reStartTask(restTemplate, oldApplicationId);
|
||||
@ -135,6 +134,7 @@ public class ApplicationWorker extends HttpWorker {
|
||||
pollTaskStatus(restTemplate, oldScaTaskId);
|
||||
} else {
|
||||
append(context,"==================SCA接口异常,调用失败=================");
|
||||
append(context,message);
|
||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-应用包审查分析节点执行失败");
|
||||
}
|
||||
Thread.currentThread().interrupt();
|
||||
|
@ -2,12 +2,10 @@ package cd.casic.ci.process.engine.worker;
|
||||
|
||||
|
||||
import cd.casic.ci.process.common.WorkAtom;
|
||||
import cd.casic.ci.process.engine.constant.EngineRuntimeConstant;
|
||||
import cd.casic.ci.process.engine.context.ConstantContextHolder;
|
||||
import cd.casic.ci.process.engine.runContext.TaskRunContext;
|
||||
import cd.casic.ci.process.engine.worker.base.HttpWorker;
|
||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||
import cd.casic.ci.process.process.dataObject.log.PipTaskLog;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
import cd.casic.ci.process.process.service.pipeline.PipelineService;
|
||||
import cd.casic.ci.process.process.service.target.impl.TargetVersionServiceImpl;
|
||||
@ -78,7 +76,7 @@ public class CodingWorker extends HttpWorker {
|
||||
body.put("applicationDescription", codingConfigInfo.get("applicationDescription")); // 应用描述(可选)
|
||||
Map<String,Object> vcsRepo = new HashMap<>();
|
||||
body.put("vcsRepo",vcsRepo);
|
||||
Integer type = (Integer) codingConfigInfo.get("type");
|
||||
Integer type = Integer.valueOf((String) codingConfigInfo.get("type"));
|
||||
vcsRepo.put("type", type);
|
||||
if (REPO_TYPE_GIT.equals(type)) {
|
||||
HashMap<String,String> gitVCSAssetRepo = new HashMap<>();
|
||||
@ -107,6 +105,7 @@ public class CodingWorker extends HttpWorker {
|
||||
//轮询请求状态
|
||||
pollTaskStatus(restTemplate, scaTaskId);
|
||||
} else if (response.getString("message").equals("应用已经存在")){
|
||||
append(context,response.getString("message"));
|
||||
Integer oldScaTaskId = (Integer) codingConfigInfo.get("taskId");
|
||||
Integer oldApplicationId = (Integer) codingConfigInfo.get("applicationId");
|
||||
int restartResult = reStartTask(restTemplate, oldApplicationId);
|
||||
@ -119,6 +118,7 @@ public class CodingWorker extends HttpWorker {
|
||||
//基于第三方文档表明500状态基本属于无镜像配置,对比失败,于是打印日志为无法对比镜像
|
||||
append(context,"==================SCA校验失败=================");
|
||||
append(context,"接口异常调用失败");
|
||||
append(context,response.getString("message"));
|
||||
localVariables.put("statusCode", "-1");
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
@ -131,6 +131,7 @@ public class ScaBinaryWorker extends HttpWorker {
|
||||
|
||||
pollTaskStatus(restTemplate, scaTaskId);
|
||||
} else if (message.equals("应用已经存在")) {
|
||||
append(context,message);
|
||||
Integer oldScaTaskId = (Integer) scaBinaryConfigInfo.get("taskId");
|
||||
Integer oldApplicationId = (Integer) scaBinaryConfigInfo.get("applicationId");
|
||||
int restartResult = reStartTask(restTemplate, oldApplicationId);
|
||||
@ -140,6 +141,7 @@ public class ScaBinaryWorker extends HttpWorker {
|
||||
pollTaskStatus(restTemplate, oldScaTaskId);
|
||||
} else {
|
||||
append(context,"==================SCA接口异常,调用失败=================");
|
||||
append(context,message);
|
||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||
}
|
||||
Thread.currentThread().interrupt();
|
||||
|
@ -129,6 +129,7 @@ public class ScaMirrorWorker extends HttpWorker {
|
||||
|
||||
pollTaskStatus(restTemplate, scaTaskId);
|
||||
} else if (message.equals("应用已经存在")) {
|
||||
append(context,message);
|
||||
Integer oldScaTaskId = (Integer) scaMirrorConfigInfo.get("taskId");
|
||||
Integer oldApplicationId = (Integer) scaMirrorConfigInfo.get("applicationId");
|
||||
int restartResult = reStartTask(restTemplate, oldApplicationId);
|
||||
@ -138,6 +139,7 @@ public class ScaMirrorWorker extends HttpWorker {
|
||||
pollTaskStatus(restTemplate, oldScaTaskId);
|
||||
} else {
|
||||
append(context,"==================SCA接口异常,调用失败=================");
|
||||
append(context,message);
|
||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||
}
|
||||
Thread.currentThread().interrupt();
|
||||
|
@ -2,13 +2,11 @@ package cd.casic.ci.process.engine.worker;
|
||||
|
||||
|
||||
import cd.casic.ci.process.common.WorkAtom;
|
||||
import cd.casic.ci.process.engine.constant.EngineRuntimeConstant;
|
||||
import cd.casic.ci.process.engine.context.ConstantContextHolder;
|
||||
import cd.casic.ci.process.engine.runContext.BaseRunContext;
|
||||
import cd.casic.ci.process.engine.runContext.TaskRunContext;
|
||||
import cd.casic.ci.process.engine.worker.base.HttpWorker;
|
||||
import cd.casic.ci.process.process.dataObject.base.PipBaseElement;
|
||||
import cd.casic.ci.process.process.dataObject.log.PipTaskLog;
|
||||
import cd.casic.ci.process.process.dataObject.pipeline.PipPipeline;
|
||||
import cd.casic.ci.process.process.dataObject.target.TargetVersion;
|
||||
import cd.casic.ci.process.process.dataObject.task.PipTask;
|
||||
@ -128,6 +126,7 @@ public class ScaSbomWorker extends HttpWorker {
|
||||
|
||||
pollTaskStatus(restTemplate, scaTaskId);
|
||||
} else if (message.equals("应用已经存在")) {
|
||||
append(context,message);
|
||||
Integer oldScaTaskId = (Integer) scaSbomConfigInfo.get("taskId");
|
||||
Integer oldApplicationId = (Integer) scaSbomConfigInfo.get("applicationId");
|
||||
int restartResult = reStartTask(restTemplate, oldApplicationId);
|
||||
@ -137,6 +136,7 @@ public class ScaSbomWorker extends HttpWorker {
|
||||
pollTaskStatus(restTemplate, oldScaTaskId);
|
||||
} else {
|
||||
append(context,"==================SCA接口异常,调用失败=================");
|
||||
append(context,message);
|
||||
throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"SCA-SBOM节点执行失败");
|
||||
}
|
||||
Thread.currentThread().interrupt();
|
||||
|
Loading…
x
Reference in New Issue
Block a user