diff --git a/agent-go/executor/CommandExecutor.go b/agent-go/executor/CommandExecutor.go index c57d627..e7880a0 100644 --- a/agent-go/executor/CommandExecutor.go +++ b/agent-go/executor/CommandExecutor.go @@ -29,15 +29,26 @@ func Execute(em *ExecutionMessage) ([]string, error) { var resultLog []string var err error var realCommand [][]string + ok := true if strings.HasPrefix(em.Type, "BASE") { // base function - resultLog = AgentOsOperatorCache.Command(em.FuncContent[0], em.FuncContent[1:]...) - err = nil + if len(em.FuncContent) > 1 { + ok, resultLog = AgentOsOperatorCache.Exec(em.FuncContent[0], em.FuncContent[1:]...) + } else { + ok, resultLog = AgentOsOperatorCache.Exec(em.FuncContent[0]) + } + if ok { + return resultLog, nil + } } else if strings.HasPrefix(em.Type, "APP") { // app function - ok, resultLog := AgentOsOperatorCache.Deploy(em.FuncContent[0], em.FuncContent[1:]...) + if len(em.FuncContent) > 1 { + ok, resultLog = AgentOsOperatorCache.Deploy(em.FuncContent[0], em.FuncContent[1:]...) + } else { + ok, resultLog = AgentOsOperatorCache.Deploy(em.FuncContent[0]) + } if ok { return resultLog, nil } else { diff --git a/agent-go/rabbitmq/OctopusMessage.go b/agent-go/rabbitmq/OctopusMessage.go index 27afdd8..80ee1ab 100644 --- a/agent-go/rabbitmq/OctopusMessage.go +++ b/agent-go/rabbitmq/OctopusMessage.go @@ -42,6 +42,7 @@ type OctopusMessage struct { func (om *OctopusMessage) Handle() { // 实际执行 OM handle进程 + log.Debug("接收到OctopusMessage,开始处理!") doHandleOctopusMessage(om) } @@ -116,6 +117,7 @@ func agentOMHandler(octopusMessage *OctopusMessage) { } func executorOMHandler(octopusMessage *OctopusMessage) { + log.Debug("开始处理 Executor Octopus Message !") // 转换类型 executionMsgString := octopusMessage.Content.(string) diff --git a/agent-go/shell/agent-bootup.sh b/agent-go/shell/agent-bootup.sh index 5c803af..793f418 100644 --- a/agent-go/shell/agent-bootup.sh +++ b/agent-go/shell/agent-bootup.sh @@ -277,7 +277,7 @@ CheckAndDownloadLatestVersion() { echo "" colorEcho $BLUE "start to download the agent config!" - agentConfigFileList=$(curl $AgentConfigUrl | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-) + agentConfigFileList=$(curl "$AgentConfigUrl/" | grep -v h1 | grep "a href=" | awk '{print$2}' | cut -d">" -f2 | cut -d"<" -f1 | cut -d"_" -f4-) for agentConfig in "${agentConfigFileList[@]}"; do colorEcho $BLUE "agent config file is => $agentConfig"