diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflCrashesInfoServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflCrashesInfoServiceImpl.java index 4d4e7f61..6e5f3a89 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflCrashesInfoServiceImpl.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflCrashesInfoServiceImpl.java @@ -63,6 +63,7 @@ public class AflCrashesInfoServiceImpl extends ServiceImpl impleme throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"pipelineId或者taskId不能为空"); } - BaseRunContext runContext = runContextManager.getContext(req.getPipelineId()); - if (ObjectUtils.isEmpty(runContext)){ - throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到运行上下文"); - } - String resourceId = runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY) instanceof String ? ((String) runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY)) : null; -// String resourceId = "1"; +// BaseRunContext runContext = runContextManager.getContext(req.getPipelineId()); +// if (ObjectUtils.isEmpty(runContext)){ +// throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到运行上下文"); +// } +// String resourceId = runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY) instanceof String ? ((String) runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY)) : null; + String resourceId = "2"; if (StringUtils.isEmpty(resourceId)){ throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到资源"); } @@ -114,11 +112,12 @@ public class AflInfoServiceImpl extends ServiceImpl impleme throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"pipelineId或者taskId不能为空"); } - BaseRunContext runContext = runContextManager.getContext(req.getPipelineId()); - if (ObjectUtils.isEmpty(runContext)){ - throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到运行上下文"); - } - String resourceId = runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY) instanceof String ? ((String) runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY)) : null; +// BaseRunContext runContext = runContextManager.getContext(req.getPipelineId()); +// if (ObjectUtils.isEmpty(runContext)){ +// throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到运行上下文"); +// } +// String resourceId = runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY) instanceof String ? ((String) runContext.getGlobalVariables().get(PipelineVariableConstant.AFL_RESOURCE_MANAGER_ID_KEY)) : null; + String resourceId = "2"; if (StringUtils.isEmpty(resourceId)){ throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"未找到资源"); } diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflPlotInfoServiceImpl.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflPlotInfoServiceImpl.java index 7ec8be35..750f56a4 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflPlotInfoServiceImpl.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/process/service/aflManager/impl/AflPlotInfoServiceImpl.java @@ -59,6 +59,7 @@ public class AflPlotInfoServiceImpl extends ServiceImpl aflSeedInfos = new ArrayList<>(0); if (!CollectionUtils.isEmpty(copiedFiles)){ - //新增数据到crashes表中 + //新增数据到seed表中 copiedFiles.forEach(o->{ AflSeedInfo aflSeedInfo = new AflSeedInfo(); diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/util/SftpUploadUtil.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/util/SftpUploadUtil.java index 0919463c..f791762c 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/util/SftpUploadUtil.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/util/SftpUploadUtil.java @@ -1069,20 +1069,13 @@ public class SftpUploadUtil { session.connect(); System.out.println("SFTP Session 连接成功."); - //切换目录 - ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp"); - sftpChannel.connect(); - try { - sftpChannel.cd(remoteDir); - System.out.println("切换到远程目录: " + remoteDir); - } catch (SftpException e) { - System.err.println("切换目录失败: " + e.getMessage()); - } - sftpChannel.disconnect(); - - // 执行命令打印输出 + // 开始执行 find 命令 ChannelExec execChannel = (ChannelExec) session.openChannel("exec"); - execChannel.setCommand("find . -maxdepth 1 -type f -exec stat -c \"%n 创建时间: %w\" {} \\;"); + + // 设置要执行的命令 + String command = "find " + remoteDir + " -maxdepth 1 -type f -exec stat -c \"%n 创建时间: %w\" {} \\;"; + execChannel.setCommand(command); + InputStream in = execChannel.getInputStream(); execChannel.connect();