reghao 5 年 前
コミット
1a792acf6f

+ 9 - 9
dmaster/src/main/java/cn/reghao/autodop/dmaster/app/service/crud/orchestarte/AppCrudService.java

@@ -62,34 +62,34 @@ public class AppCrudService implements CrudOps<AppOrchestration> {
         AppOrchestration toApp = appRepository.findByIsDeleteFalseAndAppId(to);
         if (toApp == null) {
             toApp = (AppOrchestration) fromApp.clone();
-            copyToDifferentApp(toApp, to);
+            copyToDifferentBranch(toApp, to);
             appRepository.save(toApp);
             buildDeployAppCrudService.addOrUpdate(BuildDeployApp.of(toApp));
         }
     }
 
-    private void copyToDifferentApp(AppOrchestration app, String to) {
+    private void copyToDifferentBranch(AppOrchestration app, String to) {
         app.setAppId(to);
-        app.setDescription("");
-        app.setAppRepo("");
         app.setBranch("");
+        /*app.setDescription("");
+        app.setAppRepo("");
         app.setDirname("");
         app.setCompileHome("");
 
         app.setBuildConfig(null);
         app.setDeployConfigs(null);
         app.setRunningConfig(null);
-        app.setNotifierConfig(null);
+        app.setNotifierConfig(null);*/
+        app.setDeployConfigs(null);
+        if (app.getRunningConfig() != null) {
+            app.getRunningConfig().setLogConfigs(null);
+        }
 
         app.setId(null);
         app.setCreateTime(null);
         app.setUpdateTime(null);
     }
 
-    // TODO 当前应用的另一个分支
-    private void copyToDifferentBranch(AppOrchestration app, String to) {
-    }
-
     @Override
     public PageList<AppOrchestration> getByPage(int page, int size, String env) {
         // 默认按更新时间倒序