|
|
@@ -119,7 +119,7 @@ public class EnvironmentServiceImpl implements EnvironmentService {
|
|
|
if (environment == null) {
|
|
|
throw ServiceException.BAD_REQUEST;
|
|
|
}
|
|
|
- BeanUtils.copyProperties(environmentVO, environment, "id", "appId", "buildStatus", "buildOutput", "deployStatus", "image", "buildStartTime", "deployStartTime");
|
|
|
+ BeanUtils.copyProperties(environmentVO, environment, "id", "appId", "buildStatus", "buildOutput", "deployStatus", "image", "buildStartTime", "deployStartTime", "deployOutput");
|
|
|
}
|
|
|
EnvironmentVO result = EnvironmentConverter.convertToVO(environmentDAO.save(environment));
|
|
|
ConfigVO resultConfigVO;
|
|
|
@@ -156,13 +156,17 @@ public class EnvironmentServiceImpl implements EnvironmentService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public EnvironmentVO get(Integer id) throws ServiceException {
|
|
|
+ public EnvironmentVO get(Integer id, boolean fetchAll) throws ServiceException {
|
|
|
Environment result = environmentDAO.findById(id).orElse(null);
|
|
|
if (result == null) {
|
|
|
throw ServiceException.BAD_REQUEST;
|
|
|
}
|
|
|
ConfigVO resultConfigVO = ConfigConverter.convertToVO(configDAO.findByConfigBelongsAndAndEntityId(ConfigBelongsToType.ENVIRONMENT, result.getId()));
|
|
|
EnvironmentVO vo = EnvironmentConverter.convertToVO(result);
|
|
|
+ if (fetchAll) {
|
|
|
+ vo.setBuildOutput(result.getBuildOutput());
|
|
|
+ vo.setDeployOutput(result.getDeployOutput());
|
|
|
+ }
|
|
|
vo.setConfig(resultConfigVO);
|
|
|
String labelKey = ResourceLabel.RESOURCE.getCode();
|
|
|
String labelValue = ResourceLabel.RESOURCE.getGenerator().gen("environment", String.valueOf(result.getAppId()), String.valueOf(result.getId()));
|
|
|
@@ -296,6 +300,10 @@ public class EnvironmentServiceImpl implements EnvironmentService {
|
|
|
LoggerUtil.error(logger, e, "构建失败!gitUrl={}, branchOrCommit={}", application.getGitUrl(), result.getBuildTypeValue());
|
|
|
return;
|
|
|
}
|
|
|
+ } else if (result.getBuildType() == BuildType.FROM_IMAGE) {
|
|
|
+ result.setBuildStatus(BuildStatus.SUCCESS);
|
|
|
+ result.setBuildOutput("镜像构建无需部署");
|
|
|
+ environmentDAO.save(result);
|
|
|
}
|
|
|
|
|
|
String[] ports = configContent.getServicePort().split(",");
|