Search in sources :

Example 6 with ProjectEnv

use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.

the class ProjectModuleServiceImpl method buildModuleJvms.

private List<ModuleJvm> buildModuleJvms(int moduleId) {
    List<ModuleJvm> moduleJvmArgs = moduleJvmService.queryByModuleId(moduleId);
    List<ProjectEnv> allEnv = projectEnvService.findAllEnv();
    HashMap<Integer, ModuleJvm> envId2ModuleJvmMap = Maps.newHashMap();
    for (ModuleJvm moduleJvm : moduleJvmArgs) {
        envId2ModuleJvmMap.put(moduleJvm.getEnvId(), moduleJvm);
    }
    for (ProjectEnv env : allEnv) {
        if (envId2ModuleJvmMap.get(env.getEnvId()) == null) {
            ModuleJvm newModuleJvm = new ModuleJvm();
            newModuleJvm.setEnvId(env.getEnvId());
            newModuleJvm.setEnvName(env.getEnvName());
            envId2ModuleJvmMap.put(env.getEnvId(), newModuleJvm);
        }
    }
    return Lists.newArrayList(envId2ModuleJvmMap.values());
}
Also used : ProjectEnv(com.ibeiliao.deployment.admin.vo.global.ProjectEnv) ModuleJvm(com.ibeiliao.deployment.admin.vo.project.ModuleJvm)

Example 7 with ProjectEnv

use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.

the class ViewModuleController method buildModuleJvms.

private List<ModuleJvm> buildModuleJvms(List<ProjectEnv> allEnv) {
    List<ModuleJvm> moduleJvmArgses = Lists.newArrayList();
    if (CollectionUtils.isNotEmpty(allEnv)) {
        for (ProjectEnv env : allEnv) {
            ModuleJvm moduleJvm = new ModuleJvm();
            moduleJvm.setEnvId(env.getEnvId());
            moduleJvm.setEnvName(env.getEnvName());
            moduleJvmArgses.add(moduleJvm);
        }
    }
    return moduleJvmArgses;
}
Also used : ProjectEnv(com.ibeiliao.deployment.admin.vo.global.ProjectEnv)

Example 8 with ProjectEnv

use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.

the class ViewProjectController method projectDetail.

/**
 * 查看项目详情
 */
@RequestMapping("projectDetail")
@ResponseBody
@MenuResource("项目详情")
public RestResult projectDetail(int projectId) {
    Project project = projectService.getProject(projectId);
    GlobalSetting globalSetting = globalSettingService.getGlobalSetting();
    ProjectDetailInfo projectDetailInfo = new ProjectDetailInfo();
    projectDetailInfo.setProject(project);
    projectDetailInfo.setGlobalSetting(globalSetting);
    List<ProjectEnv> allEnv = projectEnvService.findAllEnv();
    projectDetailInfo.setProjectEnvs(allEnv);
    List<ProjectModule> modules = projectModuleService.getByProjectId(projectId);
    fillServerGroupIntoModule(modules);
    fillJvmArgsIntoModule(modules);
    projectDetailInfo.setModules(modules);
    return new RestResult<>(projectDetailInfo);
}
Also used : ProjectEnv(com.ibeiliao.deployment.admin.vo.global.ProjectEnv) RestResult(com.ibeiliao.deployment.admin.common.RestResult) GlobalSetting(com.ibeiliao.deployment.admin.vo.global.GlobalSetting) MenuResource(com.ibeiliao.deployment.admin.utils.resource.MenuResource) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 9 with ProjectEnv

use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.

the class DeployHistoryServiceImpl method statLowQualityModule.

@Override
public List<LowQualityRank> statLowQualityModule(@Param("startTime") Date startTime, @Param("endTime") Date endTime) {
    List<ProjectEnv> envs = projectEnvService.findAllEnv();
    List<Integer> onlineEnvs = new ArrayList<>(envs.size());
    for (ProjectEnv env : envs) {
        if (env.getOnlineFlag() == Constants.TRUE) {
            onlineEnvs.add(env.getEnvId());
        }
    }
    if (onlineEnvs.isEmpty()) {
        return Collections.emptyList();
    }
    String env = StringUtils.join(onlineEnvs, ",");
    List<LowQualityRank> ranks = deployHistoryDao.statLowQualityModule(startTime, endTime, env, DeployStatus.DEPLOYED.getValue(), DeployResult.SUCCESS.getValue(), Constants.LOW_QUALITY_DEPLOY_TIMES);
    return ranks;
}
Also used : LowQualityRank(com.ibeiliao.deployment.admin.vo.stat.LowQualityRank) ProjectEnv(com.ibeiliao.deployment.admin.vo.global.ProjectEnv)

Example 10 with ProjectEnv

use of com.ibeiliao.deployment.admin.vo.global.ProjectEnv in project Corgi by kevinYin.

the class DeployHistoryServiceImpl method checkIfDeployingModuleWithEnv.

private void checkIfDeployingModuleWithEnv(DeploymentOrder order) {
    // 如果 module 正在 env 发布,不能再创建发布
    if (moduleStatusManagementService.isModuleDeploying(order.getModuleId(), order.getEnvId())) {
        ProjectModule module = projectModuleService.getByModuleId(order.getModuleId());
        ProjectEnv env = projectEnvService.getById(order.getEnvId());
        throw new IllegalStateException("模块 [" + module.getModuleName() + "] 正在 [" + env.getEnvName() + "] 环境发布,必须等待当前的发布结束才可以发布");
    }
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ProjectEnv(com.ibeiliao.deployment.admin.vo.global.ProjectEnv)

Aggregations

ProjectEnv (com.ibeiliao.deployment.admin.vo.global.ProjectEnv)14 DeployHistory (com.ibeiliao.deployment.admin.vo.deploy.DeployHistory)3 ProjectModule (com.ibeiliao.deployment.admin.vo.project.ProjectModule)3 RestResult (com.ibeiliao.deployment.admin.common.RestResult)2 InitTestDataService (com.ibeiliao.deployment.admin.service.InitTestDataService)2 MenuResource (com.ibeiliao.deployment.admin.utils.resource.MenuResource)2 DeploymentOrder (com.ibeiliao.deployment.admin.vo.deploy.DeploymentOrder)2 ServerDeployHistory (com.ibeiliao.deployment.admin.vo.deploy.ServerDeployHistory)2 Project (com.ibeiliao.deployment.admin.vo.project.Project)2 Server (com.ibeiliao.deployment.admin.vo.server.Server)2 ServerGroup (com.ibeiliao.deployment.admin.vo.server.ServerGroup)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 AdminAccount (com.ibeiliao.deployment.admin.vo.account.AdminAccount)1 GlobalSetting (com.ibeiliao.deployment.admin.vo.global.GlobalSetting)1 ModuleJvm (com.ibeiliao.deployment.admin.vo.project.ModuleJvm)1 LowQualityRank (com.ibeiliao.deployment.admin.vo.stat.LowQualityRank)1 ResinConf (com.ibeiliao.deployment.transfer.vo.ResinConf)1 TransferRequest (com.ibeiliao.deployment.transfer.vo.TransferRequest)1 ArrayList (java.util.ArrayList)1