[Excution] - base function accomplish union code - 1

This commit is contained in:
IceDerce
2023-06-27 15:13:48 +08:00
parent ca255e1b3f
commit 44ce0959d9
3 changed files with 19 additions and 13 deletions

View File

@@ -80,7 +80,7 @@ func INIT() *register.AgentServerInfo {
initFromServerQueue := &rabbitmq.RabbitQueue{
RabbitProp: initFromServerProp,
}
defer initFromServerQueue.Close()
//defer initFromServerQueue.Close()
// 建立连接
initFromServerQueue.Connect()
@@ -113,7 +113,10 @@ func handleInitMsgFromServer(initFromServerQueue *rabbitmq.RabbitQueue, initToSe
var serverInfo register.AgentServerInfo
s, _ := initOctopusMsg.Content.(string)
s, er := initOctopusMsg.Content.(string)
if !er {
log.ErrorF("convet to string error! => %v", er)
}
cc := json.Unmarshal([]byte(s), &serverInfo)
if cc != nil {
log.Error(fmt.Sprintf("parse init message from server wroong, message is => %v ", cc))
@@ -194,13 +197,15 @@ func parseAgentServerInfo() *register.AgentServerInfo {
func BuildAgentOsOperator(agentServerInfo *register.AgentServerInfo) {
executor.AgentOsOperatorCache = &executor.AgentOsOperator{
InstallCommandPrefix: nil,
RemoveCommandPrefix: nil,
CanAccessInternet: false,
IsOsTypeUbuntu: false,
IsAgentInnerWall: false,
AgentArch: "",
AgentOSReleaseCode: "",
InstallCommandPrefix: []string{
"apt-get", "install", "-y",
},
RemoveCommandPrefix: []string{"apt", "remove", "-y"},
CanAccessInternet: true,
IsOsTypeUbuntu: true,
IsAgentInnerWall: true,
AgentArch: "amd64",
AgentOSReleaseCode: "focal",
AgentServerInfo: agentServerInfo,
}

View File

@@ -51,11 +51,12 @@ spring:
allow-circular-references: true
allow-bean-definition-overriding: true
rabbitmq:
host: 42.192.52.227
# host: 42.192.52.227
host: 192.168.35.71
port: 20672
username: boge
password: boge8tingH
virtual-host: /wdd
virtual-host: /
listener:
simple:
retry:

View File

@@ -1,4 +1,4 @@
serverName: "Chengdu-amd64-98"
serverName: "Chengdu-amd64-90"
serverIpPbV4: "183.220.149.17"
serverIpInV4: ""
serverIpPbV6: ""