|
|
@@ -1,6 +1,8 @@
|
|
|
package cn.reghao.autodop.dmaster.app.controller;
|
|
|
|
|
|
import cn.reghao.autodop.common.config.BuildDeployResult;
|
|
|
+import cn.reghao.autodop.dmaster.app.service.AppManager;
|
|
|
+import cn.reghao.autodop.dmaster.app.service.build.AppDeploy;
|
|
|
import cn.reghao.autodop.dmaster.result.WebResult;
|
|
|
import cn.reghao.autodop.dmaster.app.service.build.BuildDispatcher;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -25,9 +27,11 @@ import java.util.Set;
|
|
|
@RequestMapping("/api/app")
|
|
|
public class BuildController {
|
|
|
private BuildDispatcher buildDispatcher;
|
|
|
+ private AppManager appManager;
|
|
|
|
|
|
- public BuildController(BuildDispatcher buildDispatcher) {
|
|
|
+ public BuildController(BuildDispatcher buildDispatcher, AppManager appManager) {
|
|
|
this.buildDispatcher = buildDispatcher;
|
|
|
+ this.appManager = appManager;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "构建应用")
|
|
|
@@ -42,7 +46,7 @@ public class BuildController {
|
|
|
if (apps.size() == 0) {
|
|
|
return new WebResult<String>().jsonResult("ok");
|
|
|
} else {
|
|
|
- results = buildDispatcher.dispatch(apps, false);
|
|
|
+ results = buildDispatcher.dispatch(apps, false, false);
|
|
|
return new WebResult<List>().jsonResult(results);
|
|
|
}
|
|
|
}
|
|
|
@@ -59,39 +63,40 @@ public class BuildController {
|
|
|
if (apps.size() == 0) {
|
|
|
return new WebResult<String>().jsonResult("ok");
|
|
|
} else {
|
|
|
- results = buildDispatcher.dispatch(apps, true);
|
|
|
+ results = buildDispatcher.dispatch(apps, true, false);
|
|
|
return new WebResult<List>().jsonResult(results);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "部署应用")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name="appId", value="应用标识", paramType="query", dataType = "String"),
|
|
|
- @ApiImplicitParam(name="appPath", value="应用地址", paramType="query", dataType = "String")
|
|
|
- })
|
|
|
- @PostMapping("/deploy")
|
|
|
- public String deployApp(@RequestParam("appId") String appId, @RequestParam("appPath") String appPath)
|
|
|
- throws Exception {
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "部署静态资源")
|
|
|
+ @ApiOperation(value = "构建部署运行应用")
|
|
|
@ApiImplicitParams(
|
|
|
@ApiImplicitParam(name="appId", value="一个或多个应用(多个应用间使用 , 分隔)",
|
|
|
paramType="path", dataType = "String")
|
|
|
)
|
|
|
- @PostMapping("/deploy/static/{appId}")
|
|
|
- public String deployStatic(@PathVariable("appId") String appId) throws Exception {
|
|
|
+ @PostMapping("/pipeline/{appId}")
|
|
|
+ public String buildDeployAndRun(@PathVariable("appId") String appId) throws Exception {
|
|
|
Set<String> apps = checkArgs(appId);
|
|
|
List<BuildDeployResult> results;
|
|
|
if (apps.size() == 0) {
|
|
|
return new WebResult<String>().jsonResult("ok");
|
|
|
} else {
|
|
|
- results = buildDispatcher.dispatch(apps, false);
|
|
|
+ results = buildDispatcher.dispatch(apps, true, true);
|
|
|
return new WebResult<List>().jsonResult(results);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "部署应用")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name="appId", value="应用标识", paramType="query", dataType = "String"),
|
|
|
+ @ApiImplicitParam(name="appPath", value="应用地址", paramType="query", dataType = "String")
|
|
|
+ })
|
|
|
+ @PostMapping("/deploy")
|
|
|
+ public String deployApp(@RequestParam("appId") String appId, @RequestParam("appPath") String appPath)
|
|
|
+ throws Exception {
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "部署 OSS 资源")
|
|
|
@ApiImplicitParams(
|
|
|
@ApiImplicitParam(name="appId", value="一个或多个应用(多个应用间使用 , 分隔)",
|