From 892be0be8859aad64944720694d94acc44aeec4d Mon Sep 17 00:00:00 2001 From: zeaslity Date: Wed, 8 Nov 2023 16:04:08 +0800 Subject: [PATCH] =?UTF-8?q?[=20Agent=20]=20[=20Executor=20]=20-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9EInstallHarbor=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- agent-go/executor/BaseFunction.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/agent-go/executor/BaseFunction.go b/agent-go/executor/BaseFunction.go index ea82c8d..1bea52a 100644 --- a/agent-go/executor/BaseFunction.go +++ b/agent-go/executor/BaseFunction.go @@ -939,19 +939,19 @@ func (op *AgentOsOperator) installHarbor() [][]string { { "sed", "-i", - "s/$HarborHostName/" + op.AgentServerInfo.ServerIPInV4 + "/g", + "s/HarborHostName/" + op.AgentServerInfo.ServerIPInV4 + "/g", "/root/wdd/harbor/harbor.yml", }, { "sed", "-i", - "s/$HarborHostPort/8033/g", + "s/HarborHostPort/8033/g", "/root/wdd/harbor/harbor.yml", }, { "sed", "-i", - "s/$HarborHostPort/V2ryStr@ngPss/g", + "s/HarborAdminPas/V2ryStr@ngPss/g", "/root/wdd/harbor/harbor.yml", }, { @@ -1009,6 +1009,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) { } // download offline file + log.Info("[install harbor] - start to download harbor offline installer !") resultOk, resultLog := AllCompleteExecutor([][]string{ { "mkdir", @@ -1058,6 +1059,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) { }) // configuration + log.Info("[install harbor] - start to download harbor config file!") AllCommandExecutor([]string{ "wget", "--no-check-certificate", @@ -1069,23 +1071,25 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) { return false, []string{"harbor config template file download error !"} } + log.Info("[install harbor] - start to modify harbor config file!") + AllCompleteExecutor([][]string{ { "sed", "-i", - "s/$HarborHostName/" + op.AgentServerInfo.ServerIPInV4 + "/g", + "s/HarborHostName/" + op.AgentServerInfo.ServerIPInV4 + "/g", "/root/wdd/harbor/harbor.yml", }, { "sed", "-i", - "s/$HarborHostPort/8033/g", + "s/HarborHostPort/8033/g", "/root/wdd/harbor/harbor.yml", }, { "sed", "-i", - "s/$HarborPassword/V2ryStr@ngPss/g", + "s/HarborAdminPas/V2ryStr@ngPss/g", "/root/wdd/harbor/harbor.yml", }})