[ Agent ] [ Executor ] - fix bugs
This commit is contained in:
@@ -628,6 +628,13 @@ func (op *AgentOsOperator) installDockerExec(args []string) (bool, []string) {
|
|||||||
return false, append(log4, "apt-get update 失败!")
|
return false, append(log4, "apt-get update 失败!")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 补充参数
|
||||||
|
if args == nil {
|
||||||
|
args = []string{
|
||||||
|
"20",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ubuntu 内部
|
// ubuntu 内部
|
||||||
var specificDockerVersion string
|
var specificDockerVersion string
|
||||||
// hard code here 5:20.10.10~3-0~ubuntu-focal
|
// hard code here 5:20.10.10~3-0~ubuntu-focal
|
||||||
@@ -1338,10 +1345,6 @@ func (op *AgentOsOperator) installZSHExec() (bool, []string) {
|
|||||||
"s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting command-not-found z themes)/g",
|
"s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting command-not-found z themes)/g",
|
||||||
"/root/.zshrc",
|
"/root/.zshrc",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
".",
|
|
||||||
"/root/.zshrc",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"chsh",
|
"chsh",
|
||||||
"-s",
|
"-s",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class BaseFuncScheduler {
|
|||||||
|
|
||||||
|
|
||||||
for (BaseFunctionEnum procedure : masterNodeProcedureList) {
|
for (BaseFunctionEnum procedure : masterNodeProcedureList) {
|
||||||
if (funcService.callBaseFuncAndJudge(
|
if (!funcService.callBaseFuncAndJudge(
|
||||||
masterTopicName,
|
masterTopicName,
|
||||||
procedure,
|
procedure,
|
||||||
null
|
null
|
||||||
@@ -113,7 +113,6 @@ public class BaseFuncScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,14 +110,46 @@ public class ExecutionServiceImpl implements ExecutionService {
|
|||||||
// 转换结果
|
// 转换结果
|
||||||
commandResultLog = (ArrayList<String>) octopusMessage.getResult();
|
commandResultLog = (ArrayList<String>) octopusMessage.getResult();
|
||||||
|
|
||||||
|
|
||||||
|
Object executionContent;
|
||||||
|
if (executionMessage
|
||||||
|
.getExecutionType()
|
||||||
|
.equals("BASE")) {
|
||||||
|
executionContent = executionMessage.getExecutionType() + "==" + executionMessage.getFuncContent();
|
||||||
|
} else if (executionMessage.getSingleLineCommand() != null) {
|
||||||
|
executionContent = executionMessage.getSingleLineCommand();
|
||||||
|
} else {
|
||||||
|
executionContent = executionMessage.getMultiLineCommand();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 解析结果
|
||||||
|
if (StringUtils.isNotBlank(octopusMessage
|
||||||
|
.getResultCode()) && octopusMessage
|
||||||
|
.getResultCode()
|
||||||
|
.startsWith("200")) {
|
||||||
|
String firstLine = String.format(
|
||||||
|
"%s 执行结果为 true",
|
||||||
|
executionContent
|
||||||
|
);
|
||||||
|
if (commandResultLog == null) {
|
||||||
|
commandResultLog = new ArrayList<>();
|
||||||
|
}
|
||||||
|
commandResultLog.add(
|
||||||
|
0,
|
||||||
|
firstLine
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// debug
|
// debug
|
||||||
log.debug(
|
log.debug(
|
||||||
"执行命令 {} {} 在规定时间内结束, 结果为 {} 返回内容为 {}",
|
"执行命令 {} {} 在规定时间内结束, 结果为 {} 返回内容为 {}",
|
||||||
executionMessage.getSingleLineCommand() == null ? executionMessage.getMultiLineCommand() : executionMessage.getSingleLineCommand(),
|
executionContent,
|
||||||
waitOK ? "已经" : "未",
|
waitOK ? "已经" : "未",
|
||||||
octopusMessage.getResultCode(),
|
octopusMessage.getResultCode(),
|
||||||
octopusMessage.getResult()
|
commandResultLog
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user