[ Agent ] [ Executor ] - fix bugs
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user