提交 3a7e78bd 编写于 作者: 偏锋书生's avatar 偏锋书生

支持调试模式启动task

上级 74cde100
......@@ -254,5 +254,6 @@ CREATE TABLE `sys_user` (
) ENGINE = InnoDB AUTO_INCREMENT = 5 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '系统用户' ROW_FORMAT = Dynamic;
INSERT INTO `common_version`(`id`, `main_version`, `main_path`, `data_version`, `data_path`, `image_group`, `author`, `update_time`, `readme`) VALUES (1, '3.0.0', 'home:/', '3.0.0', 'home:/', 'registry.cn-hangzhou.aliyuncs.com/rjzjh/duckula', 'Andy', '2020-12-24 00:00:00', '第一个版本。。。。。。');
INSERT INTO `common_version`(`id`, `main_version`, `main_path`, `data_version`, `data_path`, `image_group`, `author`, `update_time`, `readme`) VALUES (2, '3.0.1', 'home:/', '3.0.1', 'home:/', 'registry.cn-hangzhou.aliyuncs.com/rjzjh/duckula', 'Andy', '2020-12-31 00:00:00', '增加过滤重要功能');
INSERT INTO `sys_user` VALUES (1, 'admin', '123456', 'YzcmCZNvbXocrsz9dm8e', 'hulang6666@qq.com', '12345671123', 1, '太美医疗科技', '2016-11-11 11:11:11', '2016-11-11 11:11:11');
SET FOREIGN_KEY_CHECKS = 1;
......@@ -52,13 +52,12 @@ public class DeployService {
}
IDeploy deploy = (IDeploy) SpringAssit.context.getBean(commonDeploy.getDeploy());
try {
deploy.start(commonDeploy.getId(), commandType, taskId, isdebug);
Result start = deploy.start(commonDeploy.getId(), commandType, taskId, isdebug);
return start;
} catch (Throwable e) {
log.error("host 开始任务失败", e);
return Result.getError(e.getMessage());
}
Result ret = Result.getSuc("布署成功");
return ret;
}
public Result addConfig(CommandType commandType, Long taskId, Long deployId) {
......@@ -199,14 +198,14 @@ public class DeployService {
executeCommand = conn.executeCommand(commonDeploy.getDockerLogin());
}
conn.close();
if (executeCommand.isSuc()&&commonDeploy.getVersionId()!=null) {
if (executeCommand.isSuc() && commonDeploy.getVersionId() != null) {
// 同时升级版本
//CommonVersion commonVersion = commonVersionMapper.selectByMaxKey();
// CommonVersion commonVersion = commonVersionMapper.selectByMaxKey();
CommonVersion setversion = commonVersionMapper.selectById(commonDeploy.getVersionId());
commonDeploy.setVersionId(null);// 这是初始化升级,旧版本要设置为null才能升级,否则会被挡住
Result upgradeVersion = upgradeVersion(commonDeploy, setversion);
if(upgradeVersion.isSuc()) {
commonDeploy.setVersionId(setversion.getId());
if (upgradeVersion.isSuc()) {
commonDeploy.setVersionId(setversion.getId());
}
return upgradeVersion;
}
......@@ -234,21 +233,21 @@ public class DeployService {
case host:
// 更新main
mainPath = PathType.getPath(BusiTools.packVersionUrl(commonVersionNew, true), true);
//home:是返回整个tar文件 而s3://返回加压后的目录地址。
mainPath=mainPath.endsWith(".tar")?mainPath:mainPath+".tar";
// home:是返回整个tar文件 而s3://返回加压后的目录地址。
mainPath = mainPath.endsWith(".tar") ? mainPath : mainPath + ".tar";
case docker:
// 更新data
dataPath = PathType.getPath(BusiTools.packVersionUrl(commonVersionNew, false), true);
//home:是返回整个tar文件 而s3://返回加压后的目录地址。
dataPath=dataPath.endsWith(".tar")?dataPath:dataPath+".tar";
// home:是返回整个tar文件 而s3://返回加压后的目录地址。
dataPath = dataPath.endsWith(".tar") ? dataPath : dataPath + ".tar";
break;
default:
break;
}
} catch (Throwable e) {
return Result.getError("读取执行器文件错误:" + e.getMessage());
return Result.getError("读取执行器文件错误:" + e.getMessage());
}
// 1、使用duckula登陆
SSHConnection conn = null;
try {
......
......@@ -7,15 +7,12 @@ import org.apache.tapestry5.services.Request;
import org.apache.tapestry5.services.RequestGlobals;
import org.apache.tapestry5.util.TextStreamResponse;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import net.wicp.tams.app.duckula.controller.BusiTools;
import net.wicp.tams.app.duckula.controller.bean.models.CommonConsumer;
import net.wicp.tams.app.duckula.controller.bean.models.CommonTask;
import net.wicp.tams.app.duckula.controller.config.constant.CommandType;
import net.wicp.tams.app.duckula.controller.dao.CommonCheckpointMapper;
import net.wicp.tams.app.duckula.controller.dao.CommonConsumerMapper;
......@@ -29,7 +26,6 @@ import net.wicp.tams.common.Result;
import net.wicp.tams.common.apiext.CollectionUtil;
import net.wicp.tams.common.apiext.StringUtil;
import net.wicp.tams.common.apiext.json.EasyUiAssist;
import net.wicp.tams.common.binlog.alone.binlog.bean.RuleManager;
import net.wicp.tams.common.callback.IConvertValue;
import net.wicp.tams.component.annotation.HtmlJs;
import net.wicp.tams.component.constant.EasyUIAdd;
......
......@@ -35,7 +35,6 @@ import net.wicp.tams.common.apiext.StringUtil;
import net.wicp.tams.common.apiext.json.EasyUiAssist;
import net.wicp.tams.common.binlog.alone.ListenerConf.Position;
import net.wicp.tams.common.binlog.alone.binlog.bean.Rule;
import net.wicp.tams.common.binlog.alone.binlog.bean.RuleFilter;
import net.wicp.tams.common.binlog.alone.binlog.bean.RuleManager;
import net.wicp.tams.common.callback.IConvertValue;
import net.wicp.tams.component.annotation.HtmlJs;
......@@ -249,8 +248,16 @@ public class TaskManager {
*/
public TextStreamResponse onStartTask() {
final CommonTask commonTask = TapestryAssist.getBeanFromPage(CommonTask.class, requestGlobals);
Result startTask = deployService.startTask(CommandType.task, commonTask.getId(), commonTask.getDeployId(),
false);
return onStartTask(commonTask.getId(), commonTask.getDeployId(), false);
}
/**
* 开启任务,支持调试方式
*
* @return
*/
public TextStreamResponse onStartTask(long taskId, long deployid, boolean isDebug) {
Result startTask = deployService.startTask(CommandType.task, taskId, deployid, isDebug);
return TapestryAssist.getTextStreamResponse(startTask);
}
......
......@@ -502,6 +502,9 @@
$('#filterContext').textbox('textbox').blur(function(){
syncFilterRule();
});
jQuery('#q_grid').datagrid('onRowContextMenu',function(){alert(3);});
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册