Search in sources :

Example 11 with ProjectModule

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);
        }
    }
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule)

Example 12 with ProjectModule

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;
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ModuleJvm(com.ibeiliao.deployment.admin.vo.project.ModuleJvm)

Example 13 with ProjectModule

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;
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ProjectPO(com.ibeiliao.deployment.admin.po.project.ProjectPO)

Example 14 with ProjectModule

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;
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ProjectModulePO(com.ibeiliao.deployment.admin.po.project.ProjectModulePO)

Example 15 with ProjectModule

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;
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ProjectModulePO(com.ibeiliao.deployment.admin.po.project.ProjectModulePO) ModuleJvm(com.ibeiliao.deployment.admin.vo.project.ModuleJvm)

Aggregations

ProjectModule (com.ibeiliao.deployment.admin.vo.project.ProjectModule)17 ProjectEnv (com.ibeiliao.deployment.admin.vo.global.ProjectEnv)3 Project (com.ibeiliao.deployment.admin.vo.project.Project)3 Server (com.ibeiliao.deployment.admin.vo.server.Server)3 ServerGroup (com.ibeiliao.deployment.admin.vo.server.ServerGroup)3 RestResult (com.ibeiliao.deployment.admin.common.RestResult)2 DeployHistoryPO (com.ibeiliao.deployment.admin.po.deploy.DeployHistoryPO)2 ServerDeployHistoryPO (com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO)2 ProjectModulePO (com.ibeiliao.deployment.admin.po.project.ProjectModulePO)2 MenuResource (com.ibeiliao.deployment.admin.utils.resource.MenuResource)2 AdminAccount (com.ibeiliao.deployment.admin.vo.account.AdminAccount)2 ModuleJvm (com.ibeiliao.deployment.admin.vo.project.ModuleJvm)2 Test (org.junit.Test)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ProjectPO (com.ibeiliao.deployment.admin.po.project.ProjectPO)1 DeployHistory (com.ibeiliao.deployment.admin.vo.deploy.DeployHistory)1 Transactional (org.springframework.transaction.annotation.Transactional)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1