[ Agent ] [ APP ] - refresh app procedure

This commit is contained in:
zeaslity
2023-11-20 11:29:16 +08:00
parent f1b8f8efc8
commit 72269894db
7 changed files with 236 additions and 44 deletions

View File

@@ -1073,34 +1073,17 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
log.Info("[install harbor] - start to modify harbor config file!")
AllCompleteExecutor([][]string{
{
"sed",
"-i",
"s/HarborHostName/" + op.AgentServerInfo.ServerIPInV4 + "/g",
"/root/wdd/harbor/harbor.yml",
},
{
"sed",
"-i",
"s/HarborHostPort/8033/g",
"/root/wdd/harbor/harbor.yml",
},
{
"sed",
"-i",
"s/HarborAdminPas/V2ryStr@ngPss/g",
"/root/wdd/harbor/harbor.yml",
},
{
"chmod",
"+x",
"/root/wdd/harbor/install.sh",
},
AllCommandExecutor([]string{
"chmod",
"+x",
"/root/wdd/harbor/install.sh",
})
log.InfoF("[install harbor] - harbor config changed success to => %s!", op.AgentServerInfo.ServerIPInV4)
BasicReplace("/root/wdd/harbor/harbor.yml", "HarborHostName", op.AgentServerInfo.ServerIPInV4)
BasicReplace("/root/wdd/harbor/harbor.yml", "HarborHostPort", "8033")
BasicReplace("/root/wdd/harbor/harbor.yml", "HarborAdminPas", "V2ryStr@ngPss")
log.InfoF("[install harbor] - harbor config changed success to => %s!", op.AgentServerInfo.ServerIPInV4)
// install
log.Info("[install harbor] - going to start harbor !")
executor := ReadTimeCommandExecutor([]string{
@@ -1641,13 +1624,13 @@ func (op *AgentOsOperator) openBBRExec() (bool, []string) {
return true, nil
}
func (op *AgentOsOperator) ok(args []string) [][]string {
log.InfoF("base function is ok , args are => " + strings.Join(args, " "))
func (op *AgentOsOperator) ok(funcArgs []string) [][]string {
log.InfoF("base function is ok , args are => " + strings.Join(funcArgs, " "))
return [][]string{
{"ifconfig"},
}
}
func (op *AgentOsOperator) okExec(args []string) (bool, []string) {
func (op *AgentOsOperator) okExec(funcArgs []string) (bool, []string) {
return true, nil
}