|
|
@@ -121,14 +121,19 @@ public class DeploymentServiceImpl implements DeploymentService {
|
|
|
|
|
|
Pipeline pipeline = null;
|
|
|
try {
|
|
|
- pipeline = PipelineFactory.init(pipelinePO.getConfigJson(), projectPO.getName(), pipelinePO.getName(),pipelinePO.getTemplateName());
|
|
|
+ pipeline = PipelineFactory.init(pipelinePO.getConfigJson(), projectPO.getUniqueK8sNamespace(), pipelinePO.getName(),pipelinePO.getTemplateName());
|
|
|
pipeline.start();
|
|
|
history.setResult("部署成功");
|
|
|
history.setDetails(pipeline.getContext().getResult());
|
|
|
- } catch (PipelineException pipelineException) {
|
|
|
+ } catch (PipelineException e) {
|
|
|
history.setResult("部署失败");
|
|
|
history.setDetails(pipeline.getContext().getResult());
|
|
|
- throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",pipelineException);
|
|
|
+ throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
|
+ } catch (RuntimeException e){
|
|
|
+ pipeline.getContext().appendErrorResult("运行时错误: ", e);
|
|
|
+ history.setResult("部署失败");
|
|
|
+ history.setDetails(pipeline.getContext().getResult());
|
|
|
+ throw new ServiceException(HttpStatus.SC_INTERNAL_SERVER_ERROR,"应用部署失败",e);
|
|
|
} finally {
|
|
|
pipelineHistoryMapper.update(history);
|
|
|
}
|