[agent-deploy] - xzyd project
This commit is contained in:
@@ -100,48 +100,45 @@ func BastionModeInit() {
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
bastion_init.PrintBastionHelp()
|
||||
|
||||
for {
|
||||
fmt.Println()
|
||||
fmt.Print("enter ==> ")
|
||||
|
||||
fmt.Println()
|
||||
fmt.Print("enter ==> ")
|
||||
text, _ := reader.ReadString('\n')
|
||||
text = strings.TrimSpace(text)
|
||||
inputCommand := uniformInputCommand(text)
|
||||
fmt.Println("inputCommand: ", inputCommand)
|
||||
fmt.Println()
|
||||
|
||||
text, _ := reader.ReadString('\n')
|
||||
text = strings.TrimSpace(text)
|
||||
inputCommand := uniformInputCommand(text)
|
||||
fmt.Println("inputCommand: ", inputCommand)
|
||||
fmt.Println()
|
||||
|
||||
// execute the function
|
||||
switch inputCommand {
|
||||
case InstallDefaultSsh:
|
||||
beautifulPrintExeResult(agentOperator.InstallDefaultSshBastion())
|
||||
case DisableSwap:
|
||||
beautifulPrintExeResult(agentOperator.DisableSwapBastion())
|
||||
case DisableSelinux:
|
||||
beautifulPrintExeResult(agentOperator.DisableSelinuxBastion())
|
||||
case DisableFirewall:
|
||||
beautifulPrintExeResult(agentOperator.DisableFirewallBastion())
|
||||
case ModifySysConfig:
|
||||
beautifulPrintExeResult(agentOperator.ModifySysConfigBastion())
|
||||
case InstallDocker:
|
||||
beautifulPrintExeResult(agentOperator.InstallDockerBastion())
|
||||
case ModifyDockerConfig:
|
||||
beautifulPrintExeResult(agentOperator.ModifyDockerConfigBastion())
|
||||
case InstallDockerCompose:
|
||||
beautifulPrintExeResult(agentOperator.InstallDockerComposeBastion())
|
||||
case InstallMinio:
|
||||
agentOperator.InstallMinioBastion()
|
||||
case InstallHarbor:
|
||||
beautifulPrintExeResult(agentOperator.InstallHarborBastion())
|
||||
case RemoveDocker:
|
||||
beautifulPrintExeResult(agentOperator.RemoveDockerBastion())
|
||||
case Exit:
|
||||
os.Exit(0)
|
||||
case Help:
|
||||
bastion_init.PrintBastionHelp()
|
||||
default:
|
||||
fmt.Println("inputCommand is not exist ! Please input again")
|
||||
}
|
||||
// execute the function
|
||||
switch inputCommand {
|
||||
case InstallDefaultSsh:
|
||||
beautifulPrintExeResult(agentOperator.InstallDefaultSshBastion())
|
||||
case DisableSwap:
|
||||
beautifulPrintExeResult(agentOperator.DisableSwapBastion())
|
||||
case DisableSelinux:
|
||||
beautifulPrintExeResult(agentOperator.DisableSelinuxBastion())
|
||||
case DisableFirewall:
|
||||
beautifulPrintExeResult(agentOperator.DisableFirewallBastion())
|
||||
case ModifySysConfig:
|
||||
beautifulPrintExeResult(agentOperator.ModifySysConfigBastion())
|
||||
case InstallDocker:
|
||||
beautifulPrintExeResult(agentOperator.InstallDockerBastion())
|
||||
case ModifyDockerConfig:
|
||||
beautifulPrintExeResult(agentOperator.ModifyDockerConfigBastion())
|
||||
case InstallDockerCompose:
|
||||
beautifulPrintExeResult(agentOperator.InstallDockerComposeBastion())
|
||||
case InstallMinio:
|
||||
agentOperator.InstallMinioBastion()
|
||||
case InstallHarbor:
|
||||
beautifulPrintExeResult(agentOperator.InstallHarborBastion())
|
||||
case RemoveDocker:
|
||||
beautifulPrintExeResult(agentOperator.RemoveDockerBastion())
|
||||
case Exit:
|
||||
os.Exit(0)
|
||||
case Help:
|
||||
bastion_init.PrintBastionHelp()
|
||||
default:
|
||||
fmt.Println("inputCommand is not exist ! Please input again")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
var log = logger.Log
|
||||
|
||||
// C:\Users\wddsh\go\bin\gox.exe -osarch="linux/amd64" -output "build/agent-operator_{{.OS}}_{{.Arch}}"
|
||||
// C:\Users\wddsh\go\bin\gox.exe -osarch="linux/amd64" -output "build/octopus-agent_{{.OS}}_{{.Arch}}"
|
||||
// /root/go/bin/gox -osarch="linux/amd64" -output "build/octopus-agent_{{.OS}}_{{.Arch}}"
|
||||
|
||||
// bash <(curl -sL http://172.28.0.10:9000/octopus/init-script-wdd.sh) --offline --url http://172.28.0.10:9000 --agent-install
|
||||
|
||||
@@ -3,7 +3,7 @@ package c_app
|
||||
var FrontendShortNameMaps = map[string]string{
|
||||
"cmii-suav-platform-supervision": "supervision",
|
||||
"cmii-suav-platform-supervisionh5": "supervisionh5",
|
||||
"cmii-uav-platform": "platform",
|
||||
"cmii-uav-platform": "",
|
||||
"cmii-uav-platform-ai-brain": "ai-brain",
|
||||
"cmii-uav-platform-armypeople": "armypeople",
|
||||
"cmii-uav-platform-base": "base",
|
||||
|
||||
@@ -36,6 +36,13 @@
|
||||
2024-04-30-11-57-00 uavcloud-demo cmii-uav-platform 5.5.0-042903 5.5.0-043001
|
||||
2024-04-30-17-22-52 uavcloud-demo cmii-uav-industrial-portfolio 5.5.0-042901 5.5.0-043001
|
||||
2024-05-08-08-58-30 uavcloud-demo cmii-uav-industrial-portfolio 5.5.0-043001 5.5.0-050801
|
||||
2024-05-14-15-42-00 uavcloud-demo cmii-uav-material-warehouse 5.6.0 5.6.0-051401
|
||||
2024-05-14-15-49-27 uavcloud-demo cmii-uav-platform-uas 5.6.0 5.6.0-051401
|
||||
2024-05-14-15-49-31 uavcloud-demo cmii-uav-platform-uasms 5.6.0 5.6.0-051401
|
||||
2024-05-14-17-30-00 uavcloud-demo cmii-uav-platform 5.6.0 5.6.0-051401
|
||||
2024-05-15-09-55-03 uavcloud-demo cmii-uav-platform 5.6.0-051401 5.6.0-mr830-051501
|
||||
2024-05-16-18-13-14 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-051501 5.6.0-051601
|
||||
2024-05-27-09-00-19 uavcloud-demo cmii-uav-platform-media 5.6.0 5.6.0-052701
|
||||
2024-05-10-19-55-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0 5.6.0-051001
|
||||
2024-05-13-18-30-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense 5.6.0-051301
|
||||
2024-06-03-17-31-36 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-052201 5.6.0-060301
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"wdd.io/agent-common/utils"
|
||||
)
|
||||
|
||||
@@ -85,84 +88,84 @@ func main() {
|
||||
// C:\Users\wddsh\go\bin\gox.exe -osarch="linux/amd64" -output "build/operator_{{.OS}}_{{.Arch}}"
|
||||
|
||||
//RealProjectRunner()
|
||||
var mode string
|
||||
flag.StringVar(&mode, "mode", "mode", "agent run mode")
|
||||
flag.Parse()
|
||||
|
||||
BuildDefaultK8sOperator()
|
||||
|
||||
BackupAllDeploymentFromEnv(mode)
|
||||
|
||||
// 解析命令行参数
|
||||
//var mode string
|
||||
//flag.StringVar(&mode, "mode", "mode", "agent run mode")
|
||||
//flag.Parse()
|
||||
//
|
||||
//if mode == "image" {
|
||||
//BuildDefaultK8sOperator()
|
||||
//
|
||||
// BuildDefaultK8sOperator()
|
||||
// // 堡垒机模式 的 镜像美容
|
||||
// // 初始化堡垒机模式
|
||||
// for {
|
||||
//
|
||||
// reader := bufio.NewReader(os.Stdin)
|
||||
// for {
|
||||
// fmt.Printf(DLTUHelp)
|
||||
// fmt.Print("enter ==> ")
|
||||
//
|
||||
// text, _ := reader.ReadString('\n')
|
||||
// split := strings.Split(text, " ")
|
||||
// var result []string
|
||||
// for _, s := range split {
|
||||
// text = strings.TrimSpace(s)
|
||||
// if text == "" {
|
||||
// continue
|
||||
// }
|
||||
//
|
||||
// result = append(result, text)
|
||||
// }
|
||||
//
|
||||
// if len(result) != 6 {
|
||||
// fmt.Println("input error!")
|
||||
// fmt.Printf(DLTUHelp)
|
||||
// return
|
||||
// }
|
||||
//
|
||||
// ossUrlPrefix := result[1]
|
||||
// ossFileName := result[2]
|
||||
// localGzipFolderOrGzipFile := result[3]
|
||||
// harborHostFullName := result[4]
|
||||
// namespace := result[5]
|
||||
//
|
||||
// fmt.Println("ossUrlPrefix: ", ossUrlPrefix)
|
||||
// fmt.Println("ossFileName: ", ossFileName)
|
||||
// fmt.Println("localGzipFolderOrGzipFile: ", localGzipFolderOrGzipFile)
|
||||
// fmt.Println("harborHostFullName: ", harborHostFullName)
|
||||
// fmt.Println("namespace: ", namespace)
|
||||
// fmt.Println()
|
||||
//
|
||||
// downloadFromOss := true
|
||||
// if ossFileName == "0" {
|
||||
// downloadFromOss = false
|
||||
// }
|
||||
//
|
||||
// // DLTU
|
||||
// targetImageFullNameList := DownloadLoadTagUpload(downloadFromOss, ossUrlPrefix, ossFileName, localGzipFolderOrGzipFile, harborHostFullName)
|
||||
//
|
||||
// // 是否需要更新
|
||||
// if namespace != "" {
|
||||
// for _, targetImageFullName := range targetImageFullNameList {
|
||||
// if !DefaultCmiiOperator.DeploymentUpdateTagByImageFullName(namespace, targetImageFullName) {
|
||||
// fmt.Printf("[Update] update [%s] [%s] failed", namespace, targetImageFullName)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// fmt.Println()
|
||||
// }
|
||||
// }
|
||||
//} else if mode == "operator" {
|
||||
//
|
||||
//}
|
||||
//BackupAllDeploymentFromEnv(mode)
|
||||
|
||||
//解析命令行参数
|
||||
var mode string
|
||||
flag.StringVar(&mode, "mode", "mode", "agent run mode")
|
||||
flag.Parse()
|
||||
|
||||
if mode == "image" {
|
||||
|
||||
BuildDefaultK8sOperator()
|
||||
// 堡垒机模式 的 镜像美容
|
||||
// 初始化堡垒机模式
|
||||
for {
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
for {
|
||||
fmt.Printf(DLTUHelp)
|
||||
fmt.Print("enter ==> ")
|
||||
|
||||
text, _ := reader.ReadString('\n')
|
||||
split := strings.Split(text, " ")
|
||||
var result []string
|
||||
for _, s := range split {
|
||||
text = strings.TrimSpace(s)
|
||||
if text == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
result = append(result, text)
|
||||
}
|
||||
|
||||
if len(result) != 6 {
|
||||
fmt.Println("input error!")
|
||||
fmt.Printf(DLTUHelp)
|
||||
return
|
||||
}
|
||||
|
||||
ossUrlPrefix := result[1]
|
||||
ossFileName := result[2]
|
||||
localGzipFolderOrGzipFile := result[3]
|
||||
harborHostFullName := result[4]
|
||||
namespace := result[5]
|
||||
|
||||
fmt.Println("ossUrlPrefix: ", ossUrlPrefix)
|
||||
fmt.Println("ossFileName: ", ossFileName)
|
||||
fmt.Println("localGzipFolderOrGzipFile: ", localGzipFolderOrGzipFile)
|
||||
fmt.Println("harborHostFullName: ", harborHostFullName)
|
||||
fmt.Println("namespace: ", namespace)
|
||||
fmt.Println()
|
||||
|
||||
downloadFromOss := true
|
||||
if ossFileName == "0" {
|
||||
downloadFromOss = false
|
||||
}
|
||||
|
||||
// DLTU
|
||||
targetImageFullNameList := DownloadLoadTagUpload(downloadFromOss, ossUrlPrefix, ossFileName, localGzipFolderOrGzipFile, harborHostFullName)
|
||||
|
||||
// 是否需要更新
|
||||
if namespace != "" {
|
||||
for _, targetImageFullName := range targetImageFullNameList {
|
||||
if !DefaultCmiiOperator.DeploymentUpdateTagByImageFullName(namespace, targetImageFullName) {
|
||||
fmt.Printf("[Update] update [%s] [%s] failed", namespace, targetImageFullName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println()
|
||||
}
|
||||
}
|
||||
} else if mode == "operator" {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,20 +42,18 @@ public class TestImageSyncScheduler {
|
||||
));
|
||||
|
||||
ArrayList<String> ImageFullNameList = new ArrayList<>(List.of(
|
||||
// "harbor.cdcyy.com.cn/cmii/cmii-live-operator:5.2.0",
|
||||
// "harbor.cdcyy.com.cn/cmii/cmii/srs:v5.0.195"
|
||||
"harbor.cdcyy.com.cn/cmii/cmii-uav-mqtthandler:5.4.0-xmyd-050901"
|
||||
"harbor.cdcyy.com.cn/cmii/cmii-uav-platform:5.3.0-cqly-052901"
|
||||
));
|
||||
|
||||
Boolean downloadAndCompressOnly = false;
|
||||
|
||||
// String projectNamespace = "wdd"; // wdd
|
||||
// String projectNamespace = "cqlyj"; // 重庆林业局
|
||||
String projectNamespace = "cqlyj"; // 重庆林业局
|
||||
// String projectNamespace = "jlyd"; // 吉林移动
|
||||
String projectNamespace = "xmyd"; // 厦门移动
|
||||
// String projectNamespace = "xmyd"; // 厦门移动
|
||||
|
||||
// String innerWorkerAgentName = "Chengdu-amd64-65-lapwdd"; //wdd
|
||||
String innerWorkerAgentName = "Chengdu-amd64-71-3571gd"; //prod
|
||||
String innerWorkerAgentName = "Chengdu-amd64-71-3571gda5"; //prod
|
||||
|
||||
// 之下不要修改 除非你知道自己在干什么!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user