Search in sources :

Example 6 with ServerDeployHistoryPO

use of com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO in project Corgi by kevinYin.

the class DeployHistoryServiceImpl method getByServerDeployHistoryId.

@Override
public DeployHistory getByServerDeployHistoryId(int serverDeployHistoryId) {
    ServerDeployHistoryPO po = serverDeployHistoryDao.get(serverDeployHistoryId);
    DeployHistory history = null;
    if (po != null) {
        DeployHistoryPO deployPo = deployHistoryDao.get(po.getHistoryId());
        history = new DeployHistory();
        VOUtil.copy(deployPo, history);
    }
    return history;
}
Also used : ServerDeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO) DeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.DeployHistoryPO) ServerDeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO) ServerDeployHistory(com.ibeiliao.deployment.admin.vo.deploy.ServerDeployHistory) DeployHistory(com.ibeiliao.deployment.admin.vo.deploy.DeployHistory)

Example 7 with ServerDeployHistoryPO

use of com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO in project Corgi by kevinYin.

the class DeployHistoryServiceImpl method createAndSaveRestart.

private DeployHistoryPO createAndSaveRestart(long accountId, String title, int serverId) {
    Server server = serverService.getById(serverId);
    AdminAccount account = adminAccountService.getById(accountId);
    Assert.notNull(server, "服务器不存在");
    Assert.notNull(account, "管理员不存在");
    ServerGroup serverGroup = serverGroupService.getById(server.getGroupId());
    ProjectModule module = projectModuleService.getByModuleId(serverGroup.getModuleId());
    DeployHistoryPO po = new DeployHistoryPO();
    po.setTagName("");
    po.setAccountId(accountId);
    po.setAuditorId(0);
    po.setTitle(title);
    po.setCreateTime(new Date());
    po.setDeployStatus(DeployStatus.WAITING_FOR_DEPLOYMENT.getValue());
    po.setAuditTime(po.getCreateTime());
    po.setDeployServers(1);
    po.setProjectId(module.getProjectId());
    po.setModuleId(module.getModuleId());
    po.setModuleName(module.getModuleName());
    po.setVersionNo("");
    po.setIsRestart(Constants.TRUE);
    po.setEnvId(serverGroup.getEnvId());
    po.setRealName(account.getRealname());
    deployHistoryDao.insert(po);
    ServerDeployHistoryPO serverDeployHistoryPO = new ServerDeployHistoryPO();
    serverDeployHistoryPO.setHistoryId(po.getHistoryId());
    serverDeployHistoryPO.setServerId(serverId);
    serverDeployHistoryPO.setServerName(server.getServerName());
    serverDeployHistoryPO.setServerIp(server.getIp());
    serverDeployHistoryPO.setDeployStatus(ServerDeployResult.WAITING_FOR_DEPLOYMENT.getValue());
    serverDeployHistoryDao.insert(serverDeployHistoryPO);
    return deployHistoryDao.get(po.getHistoryId());
}
Also used : ProjectModule(com.ibeiliao.deployment.admin.vo.project.ProjectModule) ServerGroup(com.ibeiliao.deployment.admin.vo.server.ServerGroup) Server(com.ibeiliao.deployment.admin.vo.server.Server) ServerDeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO) DeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.DeployHistoryPO) ServerDeployHistoryPO(com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO) AdminAccount(com.ibeiliao.deployment.admin.vo.account.AdminAccount)

Aggregations

ServerDeployHistoryPO (com.ibeiliao.deployment.admin.po.deploy.ServerDeployHistoryPO)7 DeployHistoryPO (com.ibeiliao.deployment.admin.po.deploy.DeployHistoryPO)4 DeployHistory (com.ibeiliao.deployment.admin.vo.deploy.DeployHistory)2 ServerDeployHistory (com.ibeiliao.deployment.admin.vo.deploy.ServerDeployHistory)2 Server (com.ibeiliao.deployment.admin.vo.server.Server)2 AdminAccount (com.ibeiliao.deployment.admin.vo.account.AdminAccount)1 Project (com.ibeiliao.deployment.admin.vo.project.Project)1 ProjectModule (com.ibeiliao.deployment.admin.vo.project.ProjectModule)1 ServerGroup (com.ibeiliao.deployment.admin.vo.server.ServerGroup)1 ServerCollectLog (com.ibeiliao.deployment.common.vo.ServerCollectLog)1 Date (java.util.Date)1 Test (org.junit.Test)1