[ Agent ] [ Initialization ] - add harbor func - 1

This commit is contained in:
zeaslity
2023-11-09 13:58:58 +08:00
parent aae4b7a286
commit cdfa4b5d04
8 changed files with 120 additions and 101 deletions

View File

@@ -1,7 +1,6 @@
package executor
import (
"agent-go/g"
"agent-go/register"
"fmt"
"strings"
@@ -802,7 +801,7 @@ func (op *AgentOsOperator) installHelm() [][]string {
{
"wget",
"--no-check-certificate",
g.BaseFuncOssUrlPrefix + "helm-v3.12.1-linux-amd64.tar.gz",
op.OssOfflinePrefix + "helm-v3.12.1-linux-amd64.tar.gz",
"-O",
"/root/wdd/helm-v3.12.1-linux-amd64.tar.gz",
},
@@ -873,7 +872,7 @@ func (op *AgentOsOperator) modifyDockerConfig(args []string) [][]string {
},
{
"wget",
g.BaseFuncOssUrlPrefix + "daemon-config.json",
op.OssOfflinePrefix + "daemon-config.json",
"-O",
"/etc/docker/daemon.json",
},
@@ -913,7 +912,7 @@ func (op *AgentOsOperator) installHarbor() [][]string {
//{
// "wget",
// "--no-check-certificate",
// g.BaseFuncOssUrlPrefix + "harbor-offline-installer-v2.1.0.tgz",
// op.OssOfflinePrefix + "harbor-offline-installer-v2.1.0.tgz",
// "-O",
// "/root/wdd/harbor-offline-installer-v2.1.0.tgz",
//},
@@ -932,7 +931,7 @@ func (op *AgentOsOperator) installHarbor() [][]string {
{
"wget",
"--no-check-certificate",
g.BaseFuncOssUrlPrefix + "harbor-config-template.yml",
op.OssOfflinePrefix + "harbor-config-template.yml",
"-O",
"/root/wdd/harbor/harbor.yml",
},
@@ -1009,7 +1008,8 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
}
// download offline file
log.Info("[install harbor] - start to download harbor offline installer !")
harborOfflineFileURL := op.OssOfflinePrefix + "harbor-offline-installer-v2.1.0.tgz"
log.InfoF("[install harbor] - start to download harbor offline installer from => %s !", harborOfflineFileURL)
resultOk, resultLog := AllCompleteExecutor([][]string{
{
"mkdir",
@@ -1029,7 +1029,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
{
"wget",
"--no-check-certificate",
g.BaseFuncOssUrlPrefix + "harbor-offline-installer-v2.1.0.tgz",
harborOfflineFileURL,
"-qO",
"/root/wdd/harbor-offline-installer-v2.1.0.tgz",
}},
@@ -1063,7 +1063,7 @@ func (op *AgentOsOperator) installHarborExec() (bool, []string) {
AllCommandExecutor([]string{
"wget",
"--no-check-certificate",
g.BaseFuncOssUrlPrefix + "harbor-config-template.yml",
op.OssOfflinePrefix + "harbor-config-template.yml",
"-qO",
"/root/wdd/harbor/harbor.yml",
})