from vscode

This commit is contained in:
zeaslity
2023-11-13 10:25:15 +08:00
parent cdfa4b5d04
commit 3f06350089
8 changed files with 42 additions and 30 deletions

View File

@@ -907,19 +907,19 @@ func (op *AgentOsOperator) installHarbor() [][]string {
//{
// "rm",
// "-rf",
// "/root/wdd/harbor-offline-installer-v2.1.0.tgz",
// "/root/wdd/harbor-offline-installer-v2.9.0.tgz",
//},
//{
// "wget",
// "--no-check-certificate",
// op.OssOfflinePrefix + "harbor-offline-installer-v2.1.0.tgz",
// op.OssOfflinePrefix + "harbor-offline-installer-v2.9.0.tgz",
// "-O",
// "/root/wdd/harbor-offline-installer-v2.1.0.tgz",
// "/root/wdd/harbor-offline-installer-v2.9.0.tgz",
//},
{
"tar",
"-zvxf",
"/root/wdd/harbor-offline-installer-v2.1.0.tgz",
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
"-C",
"/root/wdd/",
},
@@ -994,7 +994,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
resultOk, resultLog := AllCommandExecutor([]string{
"docker-compose",
"-f",
"/root/wdd/harbor/harbor.yml",
"/root/wdd/harbor/docker-compose.yml",
"up",
"-d",
})
@@ -1008,7 +1008,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
}
// download offline file
harborOfflineFileURL := op.OssOfflinePrefix + "harbor-offline-installer-v2.1.0.tgz"
harborOfflineFileURL := op.OssOfflinePrefix + "harbor-offline-installer-v2.9.0.tgz"
log.InfoF("[install harbor] - start to download harbor offline installer from => %s !", harborOfflineFileURL)
resultOk, resultLog := AllCompleteExecutor([][]string{
{
@@ -1019,7 +1019,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
{
"rm",
"-rf",
"/root/wdd/harbor-offline-installer-v2.1.0.tgz",
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
},
{
"rm",
@@ -1031,14 +1031,14 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
"--no-check-certificate",
harborOfflineFileURL,
"-qO",
"/root/wdd/harbor-offline-installer-v2.1.0.tgz",
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
}},
)
if !resultOk {
return false, append(resultLog, "download harbor offline installer failed!")
}
if !BasicFileExistAndNotNull("/root/wdd/harbor-offline-installer-v2.1.0.tgz") {
if !BasicFileExistAndNotNull("/root/wdd/harbor-offline-installer-v2.9.0.tgz") {
return false, []string{"download harbor offline installer failed!"}
}
@@ -1047,7 +1047,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
{
"tar",
"-zvxf",
"/root/wdd/harbor-offline-installer-v2.1.0.tgz",
"/root/wdd/harbor-offline-installer-v2.9.0.tgz",
"-C",
"/root/wdd/",
},
@@ -1077,19 +1077,19 @@ func (op *AgentOsOperator) installHarborExec() (bool, []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/$HarborAdminPas/V2ryStr@ngPss/g",
"s/HarborAdminPas/V2ryStr@ngPss/g",
"/root/wdd/harbor/harbor.yml",
},
{
@@ -1103,12 +1103,16 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
// install
log.Info("[install harbor] - going to start harbor !")
ReadTimeCommandExecutor([]string{
executor := ReadTimeCommandExecutor([]string{
"bash",
"/root/wdd/harbor/install.sh",
"--with-chartmuseum",
},
)
if !executor {
return false, []string{
"[install harbor] - harbor start FAILED !",
}
}
msg := "[install harbor] - harbor start complete !"
log.Info(msg)