use of com.ibeiliao.deployment.admin.vo.project.ProjectModule in project Corgi by kevinYin.
the class CreateDeploymentController method ensureRevision.
/**
* 读取svn最大版本号,失败抛出异常
*
* @param order
*/
private void ensureRevision(final DeploymentOrder order) {
if (StringUtils.isBlank(order.getVersionNo()) && StringUtils.isNotBlank(order.getTagName())) {
ProjectModule module = projectModuleService.getByModuleId(order.getModuleId());
Assert.notNull(module, "模块不存在");
if (module.getRepoType() == ModuleRepoType.SVN.getValue()) {
ensureSvnRevision(order, module);
} else if (module.getRepoType() == ModuleRepoType.GIT.getValue()) {
ensureGitRevision(order, module);
}
}
}
use of com.ibeiliao.deployment.admin.vo.project.ProjectModule in project Corgi by kevinYin.
the class CreateDeploymentController method getJvmArgs.
private String getJvmArgs(int moduleId, int envId) {
ProjectModule module = projectModuleService.getByModuleId(moduleId);
Assert.notNull(module, "模块不存在");
List<ModuleJvm> list = module.getModuleJvms();
if (CollectionUtils.isNotEmpty(list)) {
for (ModuleJvm jvm : list) {
if (jvm.getEnvId() == envId) {
return jvm.getJvmArgs();
}
}
}
return null;
}
use of com.ibeiliao.deployment.admin.vo.project.ProjectModule in project Corgi by kevinYin.
the class ProjectModuleServiceImpl method rebuildModuleName.
private List<ProjectModule> rebuildModuleName(ArrayList<Integer> projectIds, List<ProjectModulePO> modulePOS) {
List<ProjectModule> modules = VOUtil.fromList(modulePOS, ProjectModule.class);
List<ProjectPO> projectPOS = projectDao.getByProjectIds(projectIds);
HashMap<Integer, ProjectPO> projectId2ProjectMap = Maps.newHashMap();
for (ProjectPO projectPO : projectPOS) {
projectId2ProjectMap.put(projectPO.getProjectId(), projectPO);
}
for (ProjectModule module : modules) {
if (projectId2ProjectMap.get(module.getProjectId()) != null) {
String projectName = projectId2ProjectMap.get(module.getProjectId()).getProjectName();
module.setModuleName(module.getModuleName() + "(" + projectName + ")");
}
}
return modules;
}
use of com.ibeiliao.deployment.admin.vo.project.ProjectModule in project Corgi by kevinYin.
the class ProjectModuleServiceImpl method getSimpleInfoByProjectIds.
@Override
public List<ProjectModule> getSimpleInfoByProjectIds(List<Integer> projectIds) {
List<ProjectModulePO> modulePOS = projectModuleDao.getByProjectIds(projectIds);
if (CollectionUtils.isEmpty(modulePOS)) {
return Collections.emptyList();
}
List<ProjectModule> modules = Lists.newArrayList();
for (ProjectModulePO modulePO : modulePOS) {
ProjectModule module = new ProjectModule();
module.setModuleId(modulePO.getModuleId());
module.setProjectId(modulePO.getProjectId());
module.setModuleName(modulePO.getModuleName());
module.setModuleNameZh(modulePO.getModuleNameZh());
modules.add(module);
}
return modules;
}
use of com.ibeiliao.deployment.admin.vo.project.ProjectModule in project Corgi by kevinYin.
the class ProjectModuleServiceImpl method getByModuleId.
@Override
public ProjectModule getByModuleId(int moduleId) {
Assert.isTrue(moduleId > 0, "moduleId 数值小于1");
ProjectModulePO projectModulePO = projectModuleDao.get(moduleId);
if (projectModulePO != null) {
ProjectModule projectModule = VOUtil.from(projectModulePO, ProjectModule.class);
decodeAccountAndPassword(projectModule);
List<ModuleJvm> moduleJvmArgses = buildModuleJvms(moduleId);
projectModule.setModuleJvms(moduleJvmArgses);
loadModuleConf(projectModule);
return projectModule;
}
return null;
}
Aggregations