[ 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 失败!")
|
||||
}
|
||||
|
||||
// 补充参数
|
||||
if args == nil {
|
||||
args = []string{
|
||||
"20",
|
||||
}
|
||||
}
|
||||
|
||||
// ubuntu 内部
|
||||
var specificDockerVersion string
|
||||
// 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",
|
||||
"/root/.zshrc",
|
||||
},
|
||||
{
|
||||
".",
|
||||
"/root/.zshrc",
|
||||
},
|
||||
{
|
||||
"chsh",
|
||||
"-s",
|
||||
|
||||
@@ -98,7 +98,7 @@ public class BaseFuncScheduler {
|
||||
|
||||
|
||||
for (BaseFunctionEnum procedure : masterNodeProcedureList) {
|
||||
if (funcService.callBaseFuncAndJudge(
|
||||
if (!funcService.callBaseFuncAndJudge(
|
||||
masterTopicName,
|
||||
procedure,
|
||||
null
|
||||
@@ -113,7 +113,6 @@ public class BaseFuncScheduler {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,14 +110,46 @@ public class ExecutionServiceImpl implements ExecutionService {
|
||||
// 转换结果
|
||||
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
|
||||
log.debug(
|
||||
"执行命令 {} {} 在规定时间内结束, 结果为 {} 返回内容为 {}",
|
||||
executionMessage.getSingleLineCommand() == null ? executionMessage.getMultiLineCommand() : executionMessage.getSingleLineCommand(),
|
||||
executionContent,
|
||||
waitOK ? "已经" : "未",
|
||||
octopusMessage.getResultCode(),
|
||||
octopusMessage.getResult()
|
||||
commandResultLog
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user