[ Agent ] [ Initialization ] - add harbor func

This commit is contained in:
zeaslity
2023-11-09 10:34:30 +08:00
parent 11a1215cde
commit aae4b7a286
8 changed files with 395 additions and 182 deletions

View File

@@ -969,7 +969,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
// check docker-compose
if !BasicFileExistAndNotNull("/usr/local/bin/docker-compose") {
return false, []string{
"docker-compose uninstalled ! can't install harbor!",
"[install harbor] - docker-compose uninstalled ! can't install harbor!",
}
}
@@ -987,7 +987,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
})
if ok {
alreadyInstalledLog := []string{
"install harbor, container harbor-core already running! harbor installed !",
"[install harbor] - container harbor-core already running! harbor installed !",
}
log.Info(alreadyInstalledLog[0])
@@ -1091,20 +1091,29 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
"-i",
"s/$HarborAdminPas/V2ryStr@ngPss/g",
"/root/wdd/harbor/harbor.yml",
}})
},
{
"chmod",
"+x",
"/root/wdd/harbor/install.sh",
},
})
log.InfoF("harbor config changed success to => %s!", op.AgentServerInfo.ServerIPInV4)
log.InfoF("[install harbor] - harbor config changed success to => %s!", op.AgentServerInfo.ServerIPInV4)
// install
executor, l := AllCommandExecutor([]string{
log.Info("[install harbor] - going to start harbor !")
ReadTimeCommandExecutor([]string{
"bash",
"/root/wdd/harbor/install.sh",
"--with-chartmuseum",
})
if !executor {
return false, l
}
},
)
return true, l
msg := "[install harbor] - harbor start complete !"
log.Info(msg)
return true, []string{msg}
}
func (op *AgentOsOperator) chronyToPublicNTP() [][]string {