package cn.reghao.bnt.web.devops.app.model.dto;

import cn.reghao.bnt.common.msg.constant.PackType;
import cn.reghao.jutil.jdk.web.validator.ValidEnum;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * 应用部署配置
 *
 * @author reghao
 * @date 2020-05-13 16:59:20
 */
@NoArgsConstructor
@Data
public class DeployConfigDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotBlank(message = "appId 不能为空白字符串")
    private String appId;
    @NotBlank(message = "machineId 不能为空白字符串")
    private String machineId;
    private String machineIpv4;
    @ValidEnum(value = PackType.class, message = "请选择正确的打包类型")
    private String packType;
    // packType 是 docker 时 startScript 的内容是 cn.reghao.bnt.common.dockerc.pojo.Config 序列化为 JSON 后的字符串
    // 具体参照 https://docs.docker.com/engine/api/v1.40/#operation/ContainerCreate 的 reqeust body
    private String startScript;
    private String unpackScript;
    private String startHome;
}
