diff --git a/framework/spring-boot-starter-biz-tenant/src/main/java/cd/casic/framework/tenant/config/OpsTenantAutoConfiguration.java b/framework/spring-boot-starter-biz-tenant/src/main/java/cd/casic/framework/tenant/config/OpsTenantAutoConfiguration.java index 505ae1b3..ea22017e 100644 --- a/framework/spring-boot-starter-biz-tenant/src/main/java/cd/casic/framework/tenant/config/OpsTenantAutoConfiguration.java +++ b/framework/spring-boot-starter-biz-tenant/src/main/java/cd/casic/framework/tenant/config/OpsTenantAutoConfiguration.java @@ -73,7 +73,7 @@ public class OpsTenantAutoConfiguration { // ========== Security ========== - @Bean +// @Bean public FilterRegistrationBean tenantSecurityWebFilter(TenantProperties tenantProperties, WebProperties webProperties, GlobalExceptionHandler globalExceptionHandler, diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TargetHandleWorker.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TargetHandleWorker.java index 0b0992b2..ad10d962 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TargetHandleWorker.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TargetHandleWorker.java @@ -34,38 +34,38 @@ public class TargetHandleWorker extends BaseWorker { private MachineInfoService machineInfoService; @Override public void execute(TaskRunContext context) { - String filePath = ""; - Map localVariables = context.getLocalVariables(); - PipBaseElement taskContextDef = context.getContextDef(); - if (taskContextDef instanceof PipTask pipTask){ - // 查询并下载目标文件 - String pipelineId = pipTask.getPipelineId(); - //根据流水线id查询流水线信息 - PipPipeline pipeline = (PipPipeline) getContextManager().getContext(pipelineId).getContextDef(); - //根据目标id查询目标信息 - if (StringUtils.isEmpty(pipeline.getTargetVersionId())){ - throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"目标文件不存在"); - } - TargetVersion targetVersion = targetVersionService.getById(pipeline.getTargetVersionId()); - filePath = targetVersion.getFilePath(); - File file = new File(filePath); - if (!file.exists() || !file.canRead()) { - log.error("目标文件不存在或不可读"); - localVariables.put("statusCode", "-1"); - append(context,"目标文件不存在或不可读"); - toBadEnding(); - } - // 上传文件 - String machineId = pipeline.getMachineId(); - MachineInfo byId = machineInfoService.getById(machineId); - append(context,"开始文件上传"); - try { - SftpUploadUtil.uploadFileViaSftp(byId.getMachineHost(),byId.getSshPort(),byId.getUsername(), CryptogramUtil.doDecrypt(byId.getPassword()),null,file.getAbsolutePath(),"/home/casic/706/ai_test_527",file.getName()); - } catch (SftpUploadUtil.SftpUploadException e) { - log.error("文件上传失败",e); - toBadEnding(); - } - append(context,"文件上传至"+byId.getMachineHost()+" /home/casic/706/ai_test_527"); - } +// String filePath = ""; +// Map localVariables = context.getLocalVariables(); +// PipBaseElement taskContextDef = context.getContextDef(); +// if (taskContextDef instanceof PipTask pipTask){ +// // 查询并下载目标文件 +// String pipelineId = pipTask.getPipelineId(); +// //根据流水线id查询流水线信息 +// PipPipeline pipeline = (PipPipeline) getContextManager().getContext(pipelineId).getContextDef(); +// //根据目标id查询目标信息 +// if (StringUtils.isEmpty(pipeline.getTargetVersionId())){ +// throw new ServiceException(GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR.getCode(),"目标文件不存在"); +// } +// TargetVersion targetVersion = targetVersionService.getById(pipeline.getTargetVersionId()); +// filePath = targetVersion.getFilePath(); +// File file = new File(filePath); +// if (!file.exists() || !file.canRead()) { +// log.error("目标文件不存在或不可读"); +// localVariables.put("statusCode", "-1"); +// append(context,"目标文件不存在或不可读"); +// toBadEnding(); +// } +// // 上传文件 +// String machineId = pipeline.getMachineId(); +// MachineInfo byId = machineInfoService.getById(machineId); +// append(context,"开始文件上传"); +// try { +// SftpUploadUtil.uploadFileViaSftp(byId.getMachineHost(),byId.getSshPort(),byId.getUsername(), CryptogramUtil.doDecrypt(byId.getPassword()),null,file.getAbsolutePath(),"/home/casic/706/ai_test_527",file.getName()); +// } catch (SftpUploadUtil.SftpUploadException e) { +// log.error("文件上传失败",e); +// toBadEnding(); +// } +// append(context,"文件上传至"+byId.getMachineHost()+" /home/casic/706/ai_test_527"); +// } } } diff --git a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TestWorker.java b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TestWorker.java index 844a97d8..b96f911d 100644 --- a/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TestWorker.java +++ b/modules/module-ci-process-biz/src/main/java/cd/casic/ci/process/engine/worker/TestWorker.java @@ -1,5 +1,6 @@ package cd.casic.ci.process.engine.worker; +import cd.casic.ci.common.pipeline.annotation.Plugin; import cd.casic.ci.process.engine.runContext.TaskRunContext; import cd.casic.ci.process.engine.worker.base.BaseWorker; import cd.casic.ci.process.process.dataObject.base.PipBaseElement; @@ -8,7 +9,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -//@Plugin(taskType = "test") +@Plugin(taskType = "GIT") public class TestWorker extends BaseWorker { diff --git a/modules/module-system-biz/pom.xml b/modules/module-system-biz/pom.xml index c29cac1e..79cfdeba 100644 --- a/modules/module-system-biz/pom.xml +++ b/modules/module-system-biz/pom.xml @@ -97,4 +97,26 @@ + + + + org.apache.maven.plugins + maven-compiler-plugin + + + + org.projectlombok + lombok + ${lombok.version} + + + org.mapstruct + mapstruct-processor + ${mapstruct.version} + + + + + +