|
|
@@ -1,27 +1,20 @@
|
|
|
package cn.reghao.autodop.dmaster.app.controller;
|
|
|
|
|
|
import cn.reghao.autodop.dmaster.app.entity.log.BuildDeployLog;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.log.BuildLog;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.log.DeployLog;
|
|
|
-import cn.reghao.autodop.dmaster.app.entity.orchestration.AppOrchestration;
|
|
|
import cn.reghao.autodop.dmaster.app.service.AppBuildService;
|
|
|
-import cn.reghao.autodop.dmaster.app.service.tools.updater.CommitLog;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.AppToBuild;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.PageList;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.log.BuildLogVO;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.log.CommitLogVO;
|
|
|
import cn.reghao.autodop.dmaster.app.vo.log.DeployLogVO;
|
|
|
-import cn.reghao.autodop.dmaster.app.vo.result.BuildResult;
|
|
|
import cn.reghao.autodop.dmaster.app.service.OssService;
|
|
|
import cn.reghao.autodop.dmaster.app.service.build.BuildDispatcher;
|
|
|
-import cn.reghao.autodop.dmaster.app.vo.result.DeployResult;
|
|
|
import cn.reghao.autodop.dmaster.common.webresult.WebResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.tmatesoft.svn.core.SVNException;
|
|
|
@@ -65,11 +58,11 @@ public class AppBuildController {
|
|
|
return WebResult.success("ok");
|
|
|
} else {
|
|
|
buildDeployLogs = buildDispatcher.dispatch(apps, true);
|
|
|
- List<DeployResult> deployResults = buildDeployLogs.stream()
|
|
|
- .map(BuildDeployLog::deployResult)
|
|
|
+ List<DeployLogVO> deployResultVOS = buildDeployLogs.stream()
|
|
|
+ .map(BuildDeployLog::deployLog)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
- return WebResult.success(deployResults);
|
|
|
+ return WebResult.success(deployResultVOS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -86,8 +79,8 @@ public class AppBuildController {
|
|
|
return WebResult.success("ok");
|
|
|
} else {
|
|
|
buildDeployLogs = buildDispatcher.dispatch(apps, false);
|
|
|
- List<BuildResult> buildResults = buildDeployLogs.stream()
|
|
|
- .map(BuildDeployLog::buildResult)
|
|
|
+ List<BuildLogVO> buildResults = buildDeployLogs.stream()
|
|
|
+ .map(BuildDeployLog::buildLog)
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
return WebResult.success(buildResults);
|
|
|
@@ -128,7 +121,7 @@ public class AppBuildController {
|
|
|
return new HashSet<>(Arrays.asList(array));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "待构建的应用列表")
|
|
|
+ @ApiOperation(value = "需要构建部署的应用")
|
|
|
@GetMapping("/list")
|
|
|
public ResponseEntity<String> buildList(/*@RequestParam("env") String env
|
|
|
@RequestParam("page") int page, @RequestParam("size") int size*/) {
|
|
|
@@ -142,7 +135,7 @@ public class AppBuildController {
|
|
|
return ResponseEntity.ok().body(WebResult.success(pageList));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "")
|
|
|
+ @ApiOperation(value = "代码提交日志")
|
|
|
@GetMapping("/logs/commit")
|
|
|
public ResponseEntity<String> commitLog() {
|
|
|
List<CommitLogVO> res = buildService.commitLogs();
|
|
|
@@ -153,7 +146,7 @@ public class AppBuildController {
|
|
|
return ResponseEntity.ok().body(WebResult.success(logs));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "")
|
|
|
+ @ApiOperation(value = "构建日志")
|
|
|
@GetMapping("/logs/build")
|
|
|
public ResponseEntity<String> buildLog() {
|
|
|
List<BuildLogVO> res = buildService.buildLogs();
|
|
|
@@ -164,7 +157,7 @@ public class AppBuildController {
|
|
|
return ResponseEntity.ok().body(WebResult.success(logs));
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "")
|
|
|
+ @ApiOperation(value = "部署日志")
|
|
|
@GetMapping("/logs/deploy")
|
|
|
public ResponseEntity<String> deployLog() {
|
|
|
List<DeployLogVO> res = buildService.deployLogs();
|