Merge remote-tracking branch 'origin/local-ss' into local-ss

This commit is contained in:
zeaslity
2024-06-04 16:53:47 +08:00
7 changed files with 93 additions and 59 deletions

View File

@@ -4,6 +4,9 @@ import (
"os"
image2 "wdd.io/agent-common/image"
"wdd.io/agent-common/logger"
"wdd.io/agent-operator/deploy/a_dashboard"
"wdd.io/agent-operator/deploy/a_nfs"
"wdd.io/agent-operator/deploy/b_middle"
"wdd.io/agent-operator/deploy/c_app"
"wdd.io/agent-operator/deploy/z_dep"
)
@@ -14,37 +17,38 @@ func OctopusDeploy() {
// common environment
common := &z_dep.CommonEnvironmentConfig{
WebIP: "172.28.0.251",
WebIP: "10.250.0.110",
WebPort: "8888",
HarborIP: "172.28.0.251",
HarborIP: "10.250.0.110",
HarborPort: "8033",
Namespace: "szga",
Namespace: "bjtg",
TagVersion: "5.5.0",
TenantEnv: "",
MinioPublicIP: "172.28.0.251",
MinioInnerIP: "172.28.0.251",
NFSServerIP: "172.28.0.251",
MinioPublicIP: "10.250.0.110",
MinioInnerIP: "10.250.0.110",
NFSServerIP: "10.250.0.110",
}
//a_dashboard.K8sDashboardDeploy(common)
//
//a_nfs.NFSDeploy(common)
//a_nfs.NFSTestDeploy(common)
//
//// pvc
//b_middle.PVCDeploy(common)
//
//// middlewares
//b_middle.MidMySQlDeploy(common)
//b_middle.MidRedisDeploy(common)
//b_middle.MidEmqxDeploy(common)
//b_middle.MidMongoDeploy(common)
//b_middle.MidRabbitMQDeploy(common)
//b_middle.MidRabbitMQDeploy(common)
//b_middle.MidNacosDeploy(common)
//
//configMapDeploy(common)
//c_app.IngressDeploy(common)
// kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
a_dashboard.K8sDashboardDeploy(common)
a_nfs.NFSDeploy(common)
a_nfs.NFSTestDeploy(common)
// pvc
b_middle.PVCDeploy(common)
// middlewares
b_middle.MidMySQlDeploy(common)
b_middle.MidRedisDeploy(common)
b_middle.MidEmqxDeploy(common)
b_middle.MidMongoDeploy(common)
b_middle.MidRabbitMQDeploy(common)
b_middle.MidRabbitMQDeploy(common)
b_middle.MidNacosDeploy(common)
configMapDeploy(common)
c_app.IngressDeploy(common)
gzipFilePrefix := "/root/octopus_image/xjyd/"
frontendImageVersionMap, backendImageVersionMap, _ := image2.GzipFolderPathToCmiiImageTagMaps(gzipFilePrefix)
@@ -82,6 +86,24 @@ func CmiiAppDeploy() {
}
var IgnoreCmiiBackendAppName = map[string]string{
"cmii-uav-grid-datasource": "0",
"cmii-uav-grid-manage": "",
"cmii-uav-grid-engine": "",
"cmii-uav-kpi-monitor": "",
"cmii-uav-gis-server": "",
"cmii-app-release": "",
"cmii-uav-autowaypoint": "",
"cmii-uav-integration": "",
"cmii-uav-developer": "",
"cmii-open-gateway": "",
"cmii-uav-brain": "",
"cmii-uav-data-post-process": "",
"cmii-uav-multilink": "",
"cmii-uav-alarm": "",
"cmii-uav-tower": "",
}
func backendDeploy(common *z_dep.CommonEnvironmentConfig, backendImageVersionMap map[string]string) {
os.Remove(c_app.BackendApplyFilePath)
@@ -89,7 +111,13 @@ func backendDeploy(common *z_dep.CommonEnvironmentConfig, backendImageVersionMap
for appName, tag := range backendImageVersionMap {
c_app.DefaultCmiiBackendConfig.AppName = appName
c_app.DefaultCmiiBackendConfig.ImageTag = tag
c_app.DefaultCmiiBackendConfig.Replicas = "1"
_, ok := IgnoreCmiiBackendAppName[appName]
if ok {
c_app.DefaultCmiiBackendConfig.Replicas = "0"
} else {
c_app.DefaultCmiiBackendConfig.Replicas = "1"
}
c_app.DefaultCmiiBackendConfig.BackendDeploy(common)
}
}

View File

@@ -4,6 +4,7 @@ import (
"bytes"
"fmt"
"github.com/go-playground/validator/v10"
"os"
"runtime"
"text/template"
"wdd.io/agent-common/assert"
@@ -20,7 +21,7 @@ var log = logger.Log
func init() {
switch runtime.GOOS {
case "linux":
ApplyFilePrefix = "/home/wdd/IdeaProjects/ProjectOctopus/agent-operator/deploy/z_5.5.0/"
ApplyFilePrefix = "/home/wdd/IdeaProjects/ProjectOctopus/agent-operator/deploy/z_bjtg/"
case "darwin": // macOS
ApplyFilePrefix = "MacOS value"
case "windows":
@@ -29,6 +30,7 @@ func init() {
ApplyFilePrefix = "Unknown OS"
}
_ = os.Mkdir(ApplyFilePrefix, os.ModePerm)
fmt.Printf("ApplyFilePrefix: %s\n", ApplyFilePrefix)
}