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

View File

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

View File

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