|
|
@@ -1,5 +1,12 @@
|
|
|
package cn.reghao.autodop.dmaster.app.vo.orchestration;
|
|
|
|
|
|
+import cn.reghao.autodop.common.utils.data.serializer.JsonConverter;
|
|
|
+import cn.reghao.autodop.dmaster.app.constant.*;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.BuildConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.CompilerConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.CompilerType;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.PackerConfig;
|
|
|
+import cn.reghao.autodop.dmaster.app.entity.config.build.tools.RepoConfig;
|
|
|
import cn.reghao.autodop.dmaster.app.entity.config.orchestration.ProjOrchestration;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.BuildConfigVO;
|
|
|
import lombok.Data;
|
|
|
@@ -13,7 +20,6 @@ public class ProjVO {
|
|
|
private String projId;
|
|
|
private String description;
|
|
|
private String projRepo;
|
|
|
- private String branch;
|
|
|
private String dirname;
|
|
|
private BuildConfigVO buildConfigVO;
|
|
|
|
|
|
@@ -22,7 +28,6 @@ public class ProjVO {
|
|
|
vo.projId = proj.getProjId();
|
|
|
vo.description = proj.getDescription();
|
|
|
vo.projRepo = proj.getProjRepo();
|
|
|
- vo.branch = proj.getBranch();
|
|
|
vo.dirname = proj.getDirname();
|
|
|
vo.buildConfigVO = BuildConfigVO.from(proj.getBuildConfig());
|
|
|
return vo;
|
|
|
@@ -33,9 +38,45 @@ public class ProjVO {
|
|
|
proj.setProjId(vo.projId);
|
|
|
proj.setDescription(vo.description);
|
|
|
proj.setProjRepo(vo.projRepo);
|
|
|
- proj.setBranch(vo.branch);
|
|
|
proj.setDirname(vo.dirname);
|
|
|
proj.setBuildConfig(BuildConfigVO.to(vo.getBuildConfigVO()));
|
|
|
return proj;
|
|
|
}
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ ProjOrchestration proj = new ProjOrchestration();
|
|
|
+ proj.setProjId("spiderlab");
|
|
|
+ proj.setDescription("分布式爬虫系统");
|
|
|
+ proj.setProjRepo("http://git.reghao.cn/reghao/spiderlab.git");
|
|
|
+ proj.setDirname("spiderlab");
|
|
|
+
|
|
|
+ /* 构建配置 */
|
|
|
+ BuildConfig buildConfig = new BuildConfig();
|
|
|
+ RepoConfig repoConfig = new RepoConfig();
|
|
|
+ repoConfig.setName("git-codeup");
|
|
|
+ repoConfig.setType(RepoType.git.name());
|
|
|
+ repoConfig.setAuthType(RepoAuthType.ssh.name());
|
|
|
+ repoConfig.setRsaPrikey("rsa private key");
|
|
|
+ buildConfig.setRepoConfig(repoConfig);
|
|
|
+
|
|
|
+ CompilerConfig compilerConfig = new CompilerConfig();
|
|
|
+ compilerConfig.setName("dotnet5-dev");
|
|
|
+ compilerConfig.setType(CompilerType.dotnet.name());
|
|
|
+ compilerConfig.setHomePath("/home/reghao/dev/env/dotnet/dotnet-sdk-5.0.100-linux-x64");
|
|
|
+ compilerConfig.setBinPath("/home/reghao/dev/env/dotnet/dotnet-sdk-5.0.100-linux-x64/dotnet");
|
|
|
+ compilerConfig.setEnv("dev");
|
|
|
+ compilerConfig.setVersion("5.0");
|
|
|
+ compilerConfig.setCompileCmd("dotnet publish");
|
|
|
+ buildConfig.setCompilerConfig(compilerConfig);
|
|
|
+
|
|
|
+ PackerConfig packerConfig = new PackerConfig();
|
|
|
+ packerConfig.setName("docker-dev");
|
|
|
+ packerConfig.setType(PackerType.docker.name());
|
|
|
+ packerConfig.setTargetPath("docker.alpha.iquizoo.com/iq3x");
|
|
|
+ buildConfig.setPackerConfig(packerConfig);
|
|
|
+ proj.setBuildConfig(buildConfig);
|
|
|
+
|
|
|
+ String json = JsonConverter.objectToJson(ProjVO.from(proj));
|
|
|
+ System.out.println(json);
|
|
|
+ }
|
|
|
}
|