package cn.reghao.bnt.web.devops.app.service;

import cn.reghao.bnt.common.msg.event.EvtAppStatResult;
import cn.reghao.bnt.web.devops.app.model.dto.DeployConfigDto;
import cn.reghao.bnt.web.devops.app.model.dto.DeployConfigUpdateDto;
import cn.reghao.bnt.web.devops.app.model.po.AppBuilding;
import cn.reghao.bnt.web.devops.machine.model.po.MachineHost;
import cn.reghao.jutil.jdk.web.result.Result;

/**
 * @author reghao
 * @date 2021-10-22 14:45:22
 */
public interface AppDeployService {
    Result addDeployConfig(DeployConfigDto deployConfigDto);
    Result updateStartScript(DeployConfigUpdateDto deployConfigUpdateDto);
    Result deleteDeployConfig(int appDeployConfigId);
    Result deleteByApp(String appId);
    void deleteByMachineHost(MachineHost machineHost);
    void deleteAppDeploying(String appId, String machineId);
    void deleteDeployLog(String buildLogId);

    void updateAfterBuild(AppBuilding appBuilding);
    void updateBeforeDeploy(AppBuilding appBuilding, String machineId, String deployBy);
    void updateAfterDeploy(EvtAppStatResult statResult);
    void updateAppDeployingNode(EvtAppStatResult statResult);
}
