[Agent][Deploy] - cmii update

This commit is contained in:
zeaslity
2024-06-14 10:37:40 +08:00
parent 540d69ede2
commit d86bc43b28
799 changed files with 48148 additions and 203 deletions

43
agent-deploy/c_app/DeployCmiiApp.go Normal file → Executable file
View File

@@ -32,27 +32,8 @@ type CmiiFrontendConfig struct {
var (
DefaultCmiiBackendConfig = &CmiiBackendConfig{}
DefaultCmiiFrontendConfig = &CmiiFrontendConfig{}
BackendApplyFilePath = ""
FrontendApplyFilePath = ""
SRSApplyFilePath = ""
IngresApplyFilePath = ""
ConfigMapApplyFilePath = ""
)
func init() {
BackendApplyFilePath = z_dep.ApplyFilePrefix + "k8s-backend.yaml"
FrontendApplyFilePath = z_dep.ApplyFilePrefix + "k8s-frontend.yaml"
SRSApplyFilePath = z_dep.ApplyFilePrefix + "k8s-srs.yaml"
IngresApplyFilePath = z_dep.ApplyFilePrefix + "k8s-ingress.yaml"
ConfigMapApplyFilePath = z_dep.ApplyFilePrefix + "k8s-configmap.yaml"
log.DebugF("backend apply file path: %s\n", BackendApplyFilePath)
log.DebugF("frontend apply file path: %s\n", FrontendApplyFilePath)
log.DebugF("srs apply file path: %s\n", SRSApplyFilePath)
log.DebugF("ingress apply file path: %s\n", IngresApplyFilePath)
log.DebugF("config map apply file path: %s\n", ConfigMapApplyFilePath)
}
func (backend *CmiiBackendConfig) BackendDeploy(common *z_dep.CommonEnvironmentConfig) bool {
// copy
@@ -65,16 +46,16 @@ func (backend *CmiiBackendConfig) BackendDeploy(common *z_dep.CommonEnvironmentC
return false
}
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendDeploymentTemplate, BackendApplyFilePath) {
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendDeploymentTemplate, z_dep.BackendApplyFilePath) {
return false
}
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendServiceTemplate, BackendApplyFilePath) {
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendServiceTemplate, z_dep.BackendApplyFilePath) {
return false
}
// pvc
if backend.NeedPvcCache {
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendPVCTemplate, BackendApplyFilePath) {
if !z_dep.ParseEnvToApplyFile(backend, CmiiBackendPVCTemplate, z_dep.BackendApplyFilePath) {
return false
}
}
@@ -94,10 +75,10 @@ func (frontend *CmiiFrontendConfig) FrontendDeploy(common *z_dep.CommonEnvironme
return false
}
if !z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendDeploymentTemplate, FrontendApplyFilePath) {
if !z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendDeploymentTemplate, z_dep.FrontendApplyFilePath) {
return false
}
if !z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendServiceTemplate, FrontendApplyFilePath) {
if !z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendServiceTemplate, z_dep.FrontendApplyFilePath) {
return false
}
@@ -115,19 +96,19 @@ func (frontend *CmiiFrontendConfig) ConfigMapDeploy(commonEnv *z_dep.CommonEnvir
return false
}
return z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendConfigMapTemplate, ConfigMapApplyFilePath)
return z_dep.ParseEnvToApplyFile(frontend, CmiiFrontendConfigMapTemplate, z_dep.ConfigMapApplyFilePath)
}
func IngressDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
if !commonEnv.ParseCommonEnvToApplyFile(CmiiFrontendIngressTemplate, IngresApplyFilePath) {
if !commonEnv.ParseCommonEnvToApplyFile(CmiiFrontendIngressTemplate, z_dep.IngresApplyFilePath) {
return false
}
if !commonEnv.ParseCommonEnvToApplyFile(CmiiBackendIngressTemplate, IngresApplyFilePath) {
if !commonEnv.ParseCommonEnvToApplyFile(CmiiBackendIngressTemplate, z_dep.IngresApplyFilePath) {
return false
}
if !commonEnv.ParseCommonEnvToApplyFile(CmiiGatewayIngressTemplate, IngresApplyFilePath) {
if !commonEnv.ParseCommonEnvToApplyFile(CmiiGatewayIngressTemplate, z_dep.IngresApplyFilePath) {
return false
}
@@ -135,10 +116,10 @@ func IngressDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
}
func SRSDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
os.Remove(SRSApplyFilePath)
return commonEnv.ParseCommonEnvToApplyFile(CmiiSrsTemplate, SRSApplyFilePath)
os.Remove(z_dep.SRSApplyFilePath)
return commonEnv.ParseCommonEnvToApplyFile(CmiiSrsTemplate, z_dep.SRSApplyFilePath)
}
func FrontendDefaultNginxDeploy(commonEnv *z_dep.CommonEnvironmentConfig) bool {
return commonEnv.ParseCommonEnvToApplyFile(CmiiFrontendDefaultNginxConfTemplate, FrontendApplyFilePath)
return commonEnv.ParseCommonEnvToApplyFile(CmiiFrontendDefaultNginxConfTemplate, z_dep.FrontendApplyFilePath)
}

0
agent-deploy/c_app/DeployCmiiApp_test.go Normal file → Executable file
View File

4
agent-deploy/c_app/FrontendConfigMap.go Normal file → Executable file
View File

@@ -25,6 +25,9 @@ var FrontendShortNameMaps = map[string]string{
"cmii-uav-platform-threedsimulation": "threedsimulation",
"cmii-uav-platform-jiangsuwenlv": "jiangsuwenlv",
"cmii-uav-platform-qinghaitourism": "qinghaitourism",
"cmii-uav-platform-qingdao": "qingdao",
"cmii-uav-platform-hljtt": "hljtt",
"cmii-uav-platform-visualization": "visualization",
}
var FrontendClientIdMaps = map[string]string{
@@ -54,4 +57,5 @@ var FrontendClientIdMaps = map[string]string{
"cmii-uav-platform-visualization": "empty",
"cmii-uav-platform-traffic": "APP_Jc8i2wOQ1t73QEJS",
"cmii-uav-platform-jiangsuwenlv": "empty",
"cmii-uav-platform-hljtt": "empty",
}

0
agent-deploy/c_app/TemplateCmiiBackend.go Normal file → Executable file
View File

0
agent-deploy/c_app/TemplateCmiiFrontend.go Normal file → Executable file
View File

0
agent-deploy/c_app/TemplateCmiiSRS.go Normal file → Executable file
View File

0
agent-deploy/c_app/TemplateIngressConfigMap.go Normal file → Executable file
View File