use of com.ibeiliao.deployment.transfer.service.JavaTransferService in project Corgi by kevinYin.
the class TestTransfer method testTransform.
@Test
public void testTransform() {
TransferRequest transferRequest = new TransferRequest();
transferRequest.setHistoryId(20);
transferRequest.setSaveFileName("dev/statement-impl.tar.gz");
transferRequest.setModuleName("statement-impl");
transferRequest.setEnv("dev");
transferRequest.setModuleType(ModuleType.SERVICE.getValue());
transferRequest.setTargetServerIps(Lists.newArrayList("123.56.158.175"));
transferRequest.setProjectName("pay");
transferRequest.setRestartShell("com.alibaba.dubbo.container.Main");
transferRequest.setJvmArgs("-Xms128m -Xmx192m -server -d64");
// 发布 重启 stop
JavaTransferService javaTransferService = new JavaTransferService(transferRequest, DeployType.STOP);
javaTransferService.pushPackageToServer();
// JavaTransferService.buildModuleRestartShell(transferRequest, new TransferResult());
}
use of com.ibeiliao.deployment.transfer.service.JavaTransferService in project Corgi by kevinYin.
the class ViewProjectController method stopServer.
/**
* 停止服务
*/
@RequestMapping("stopServer.do")
@ResponseBody
@MenuResource("停止服务")
public RestResult<Object> stopServer(int serverId) {
TransferRequest request;
try {
request = createTransferRequest(serverId, false);
Assert.isTrue(request.getModuleType() != ModuleType.STATIC.getValue(), "静态项目不能stop");
JavaTransferService javaTransferService = new JavaTransferService(request, DeployType.STOP);
return transfer(request.getHistoryId(), javaTransferService);
} catch (Exception e) {
logger.info("停止失败,{}", e);
return new RestResult<>(ApiCode.FAILURE, "停止失败");
}
}
use of com.ibeiliao.deployment.transfer.service.JavaTransferService in project Corgi by kevinYin.
the class ViewProjectController method restartServer.
/**
* 重启服务
*/
@RequestMapping("restartServer.do")
@ResponseBody
@MenuResource("重启服务")
public RestResult<Object> restartServer(int serverId) {
TransferRequest request;
try {
request = createTransferRequest(serverId, true);
Assert.isTrue(request.getModuleType() != ModuleType.STATIC.getValue(), "静态项目不能执行重启");
JavaTransferService javaTransferService = new JavaTransferService(request, DeployType.RESTART);
return transfer(request.getHistoryId(), javaTransferService);
} catch (Exception e) {
logger.info("重启失败, {}", e);
return new RestResult<>(ApiCode.FAILURE, "重启失败");
}
}
Aggregations