|
@@ -3,6 +3,7 @@ package cn.reghao.autodop.dmaster.app.entity;
|
|
|
import cn.reghao.autodop.common.result.ResultStatus;
|
|
import cn.reghao.autodop.common.result.ResultStatus;
|
|
|
import cn.reghao.autodop.common.utils.DateTimeConverter;
|
|
import cn.reghao.autodop.common.utils.DateTimeConverter;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.AppOrchestration;
|
|
import cn.reghao.autodop.dmaster.app.entity.config.AppOrchestration;
|
|
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.deploy.RunningConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.log.BuildLog;
|
|
import cn.reghao.autodop.dmaster.app.entity.log.BuildLog;
|
|
|
import cn.reghao.autodop.dmaster.app.service.bd.tools.repo.CommitInfo;
|
|
import cn.reghao.autodop.dmaster.app.service.bd.tools.repo.CommitInfo;
|
|
|
import cn.reghao.autodop.dmaster.common.orm.BaseEntity;
|
|
import cn.reghao.autodop.dmaster.common.orm.BaseEntity;
|
|
@@ -22,23 +23,48 @@ import java.time.LocalDateTime;
|
|
|
@EqualsAndHashCode(callSuper = false)
|
|
@EqualsAndHashCode(callSuper = false)
|
|
|
@Entity
|
|
@Entity
|
|
|
public class AppBuilding extends BaseEntity<Integer> {
|
|
public class AppBuilding extends BaseEntity<Integer> {
|
|
|
- private String buildLogId;
|
|
|
|
|
private String appId;
|
|
private String appId;
|
|
|
- //private Integer httpPort;
|
|
|
|
|
|
|
+ private String appName;
|
|
|
private String env;
|
|
private String env;
|
|
|
private String appType;
|
|
private String appType;
|
|
|
private String branch;
|
|
private String branch;
|
|
|
|
|
+ private Integer httpPort;
|
|
|
|
|
+
|
|
|
|
|
+ private String buildLogId;
|
|
|
private String commitId;
|
|
private String commitId;
|
|
|
private LocalDateTime commitTime;
|
|
private LocalDateTime commitTime;
|
|
|
private String buildResult;
|
|
private String buildResult;
|
|
|
private LocalDateTime buildTime;
|
|
private LocalDateTime buildTime;
|
|
|
|
|
+ private String packagePath;
|
|
|
private String buildBy;
|
|
private String buildBy;
|
|
|
|
|
|
|
|
public AppBuilding(AppOrchestration app) {
|
|
public AppBuilding(AppOrchestration app) {
|
|
|
this.appId = app.getAppId();
|
|
this.appId = app.getAppId();
|
|
|
|
|
+ this.appName = app.getAppName();
|
|
|
this.env = app.getEnv();
|
|
this.env = app.getEnv();
|
|
|
this.appType = app.getAppType();
|
|
this.appType = app.getAppType();
|
|
|
this.branch = app.getBranch();
|
|
this.branch = app.getBranch();
|
|
|
|
|
+ RunningConfig runningConfig = app.getRunningConfig();
|
|
|
|
|
+ if (runningConfig != null) {
|
|
|
|
|
+ this.httpPort = runningConfig.getHttpPort();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.httpPort = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public AppBuilding refresh(AppOrchestration app) {
|
|
|
|
|
+ this.appName = app.getAppName();
|
|
|
|
|
+ this.env = app.getEnv();
|
|
|
|
|
+ this.appType = app.getAppType();
|
|
|
|
|
+ this.branch = app.getBranch();
|
|
|
|
|
+ RunningConfig runningConfig = app.getRunningConfig();
|
|
|
|
|
+ if (runningConfig != null) {
|
|
|
|
|
+ this.httpPort = runningConfig.getHttpPort();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.httpPort = 0;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return this;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static AppBuilding from(BuildLog buildLog) {
|
|
public static AppBuilding from(BuildLog buildLog) {
|
|
@@ -62,6 +88,7 @@ public class AppBuilding extends BaseEntity<Integer> {
|
|
|
appBuilding.setBuildResult(ResultStatus.FAIL.getMsg());
|
|
appBuilding.setBuildResult(ResultStatus.FAIL.getMsg());
|
|
|
}
|
|
}
|
|
|
appBuilding.setBuildTime(buildLog.getBuildTime().getBuildTime());
|
|
appBuilding.setBuildTime(buildLog.getBuildTime().getBuildTime());
|
|
|
|
|
+ appBuilding.setPackagePath(buildLog.getPackagePath());
|
|
|
return appBuilding;
|
|
return appBuilding;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|