|
@@ -98,7 +98,7 @@ public class DeploymentServiceImpl implements DeploymentService {
|
|
|
ProjectPO projectPO = projectMapper.getProjectById(projectId);
|
|
ProjectPO projectPO = projectMapper.getProjectById(projectId);
|
|
|
//历史记录
|
|
//历史记录
|
|
|
PipelineRecordPO record = PipelineRecordPO.builder()
|
|
PipelineRecordPO record = PipelineRecordPO.builder()
|
|
|
- .result("部署中")
|
|
|
|
|
|
|
+ .result(PipelineRecordPO.DEPLOYING)
|
|
|
.pipelineId(pipelinePO.getId())
|
|
.pipelineId(pipelinePO.getId())
|
|
|
.userId(userId)
|
|
.userId(userId)
|
|
|
.details("")
|
|
.details("")
|
|
@@ -128,15 +128,15 @@ public class DeploymentServiceImpl implements DeploymentService {
|
|
|
pipeline = PipelineFactory.init(pipelinePO.getConfigJson(), projectPO.getUniqueK8sNamespace(), pipelinePO.getName());
|
|
pipeline = PipelineFactory.init(pipelinePO.getConfigJson(), projectPO.getUniqueK8sNamespace(), pipelinePO.getName());
|
|
|
pipeline.addConfig("pipelineRecordId", record.getId().toString());
|
|
pipeline.addConfig("pipelineRecordId", record.getId().toString());
|
|
|
pipeline.start();
|
|
pipeline.start();
|
|
|
- record.setResult("部署成功");
|
|
|
|
|
|
|
+ record.setResult(PipelineRecordPO.DEPLOY_SUCCESS);
|
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
|
} catch (PipelineException e) {
|
|
} catch (PipelineException e) {
|
|
|
- record.setResult("部署失败");
|
|
|
|
|
|
|
+ record.setResult(PipelineRecordPO.DEPLOY_FAIL);
|
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
|
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
|
} catch (RuntimeException e){
|
|
} catch (RuntimeException e){
|
|
|
pipeline.getContext().appendErrorResult("运行时错误: ", e);
|
|
pipeline.getContext().appendErrorResult("运行时错误: ", e);
|
|
|
- record.setResult("部署失败");
|
|
|
|
|
|
|
+ record.setResult(PipelineRecordPO.DEPLOY_FAIL);
|
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
record.setDetails(pipeline.getContext().getResult());
|
|
|
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
|
} finally {
|
|
} finally {
|