[Agent][Deploy] - update cmii frontend
This commit is contained in:
@@ -54,7 +54,7 @@ spec:
|
||||
memory: 500Mi
|
||||
volumeMounts:
|
||||
- name: nginx-conf
|
||||
mountPath: /usr/local/nginx/conf/nginx.conf
|
||||
mountPath: /etc/nginx/conf.d/nginx.conf
|
||||
subPath: nginx.conf
|
||||
- name: tenant-prefix
|
||||
subPath: ingress-config.js
|
||||
|
||||
@@ -34,34 +34,19 @@ metadata:
|
||||
cmii.type: frontend
|
||||
data:
|
||||
nginx.conf: |
|
||||
user root;
|
||||
worker_processes auto;
|
||||
server {
|
||||
listen 9528;
|
||||
server_name localhost;
|
||||
gzip on;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
location / {
|
||||
root /home/cmii-platform/dist;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
sendfile on;
|
||||
|
||||
keepalive_timeout 600;
|
||||
|
||||
server {
|
||||
listen 9528;
|
||||
server_name localhost;
|
||||
gzip on;
|
||||
|
||||
location / {
|
||||
root /home/cmii-platform/dist;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
@@ -8,36 +8,22 @@ metadata:
|
||||
cmii.type: frontend
|
||||
data:
|
||||
nginx.conf: |
|
||||
user root;
|
||||
worker_processes auto;
|
||||
server {
|
||||
listen 9528;
|
||||
server_name localhost;
|
||||
gzip on;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
http {
|
||||
include mime.types;
|
||||
default_type application/octet-stream;
|
||||
location / {
|
||||
root /home/cmii-platform/dist;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
sendfile on;
|
||||
|
||||
keepalive_timeout 600;
|
||||
|
||||
server {
|
||||
listen 9528;
|
||||
server_name localhost;
|
||||
gzip on;
|
||||
|
||||
location / {
|
||||
root /home/cmii-platform/dist;
|
||||
index index.html index.htm;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root html;
|
||||
}
|
||||
}
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
|
||||
@@ -63,14 +63,6 @@ type CommonEnvironmentConfig struct {
|
||||
ApplyFilePrefix string
|
||||
}
|
||||
|
||||
//func (env *CommonEnvironmentConfig) CompactEnv() {
|
||||
//
|
||||
// copySameFields(env, c_app.DefaultCmiiBackendConfig)
|
||||
// copySameFields(env, c_app.DefaultCmiiFrontendConfig)
|
||||
//}
|
||||
//
|
||||
//
|
||||
|
||||
func (env *CommonEnvironmentConfig) ValidateAndUniform() bool {
|
||||
validate := validator.New()
|
||||
err := validate.Struct(env)
|
||||
|
||||
@@ -13,6 +13,7 @@ diskTotal: "914.9 GB"
|
||||
diskUsage: "12.3 GB"
|
||||
archInfo: "x86_64 (64 Bit)"
|
||||
osInfo: "
|
||||
|
||||
Ubuntu 20.04.5 LTS"
|
||||
osKernelInfo: "5.4.0-135-generic"
|
||||
tcpControl: "bbr "
|
||||
|
||||
@@ -8,6 +8,10 @@ import (
|
||||
|
||||
func TestCmiiEnvDeploy(t *testing.T) {
|
||||
|
||||
// dev
|
||||
// devflight
|
||||
// devoperation
|
||||
|
||||
deployNamespace := devFlight
|
||||
|
||||
// deploy to cmii environment
|
||||
|
||||
@@ -253,7 +253,7 @@ func TestUpdateCmiiDeploymentImageTag(t *testing.T) {
|
||||
// 计算20:00的时间
|
||||
now := time.Now()
|
||||
|
||||
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 17, 35, 00, 0, now.Location())
|
||||
targetTime := time.Date(now.Year(), now.Month(), now.Day(), 10, 05, 00, 0, now.Location())
|
||||
|
||||
duration := time.Duration(0)
|
||||
|
||||
@@ -277,11 +277,10 @@ func TestUpdateCmiiDeploymentImageTag(t *testing.T) {
|
||||
appNameTagMap := map[string]string{
|
||||
//"cmii-uav-platform-dispatchh5": "5.6.0-062401",
|
||||
//"cmii-uav-data-post-process": "5.6.0-062401",
|
||||
"cmii-uav-industrial-portfolio": "5.6.0-071501",
|
||||
//"cmii-uav-multilink": "5.5.0",
|
||||
//"cmii-uav-developer": "5.6.0-062701",
|
||||
"cmii-uav-platform": "5.6.0-070401",
|
||||
"cmii-uav-platform-share": "5.6.0-070401",
|
||||
"cmii-uav-industrial-portfolio": "5.6.0-070401",
|
||||
//"cmii-uav-platform": "5.6.0-0626",
|
||||
}
|
||||
|
||||
for appName, newTag := range appNameTagMap {
|
||||
|
||||
@@ -2,6 +2,7 @@ package image
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
"wdd.io/agent-common/utils"
|
||||
)
|
||||
@@ -10,10 +11,10 @@ var DefaultHarborOperator *HarborOperator
|
||||
|
||||
func TestHarborOperator_BuildOperator(t *testing.T) {
|
||||
harborOperator := &HarborOperator{
|
||||
HarborHost: "http://harbor.wdd.io",
|
||||
HarborPort: "8033",
|
||||
HarborUser: "",
|
||||
HarborPass: "",
|
||||
HarborHost: "http://harbor.cdcyy.com.cn",
|
||||
HarborPort: "",
|
||||
HarborUser: "rad02_drone",
|
||||
HarborPass: "Drone@1234",
|
||||
HarborClient: nil,
|
||||
}
|
||||
|
||||
@@ -32,7 +33,7 @@ func TestHarborOperator_RepoListAll(t *testing.T) {
|
||||
TestHarborOperator_BuildOperator(t)
|
||||
|
||||
//repoListAll := DefaultHarborOperator.RepoListAll("ran")
|
||||
repoListAll := DefaultHarborOperator.RepoListAll("rancher")
|
||||
repoListAll := DefaultHarborOperator.RepoListAll("cmii")
|
||||
|
||||
utils.BeautifulPrint(repoListAll)
|
||||
|
||||
@@ -54,11 +55,43 @@ func TestHarborOperator_ArtifactListAll(t *testing.T) {
|
||||
artifactListAll := DefaultHarborOperator.ArtifactListAll("cmii", "cmii-uav-user")
|
||||
|
||||
for _, artifact := range artifactListAll {
|
||||
//if len(artifact.Tags) == 0 {
|
||||
// fmt.Println(artifact.Digest)
|
||||
//}
|
||||
for _, tag := range artifact.Tags {
|
||||
fmt.Println(tag.Name)
|
||||
}
|
||||
}
|
||||
utils.BeautifulPrint(artifactListAll)
|
||||
//utils.BeautifulPrint(artifactListAll)
|
||||
|
||||
}
|
||||
|
||||
func TestHarborOperator_CmiiHarborCleanUp(t *testing.T) {
|
||||
TestHarborOperator_BuildOperator(t)
|
||||
|
||||
//repoListAll := DefaultHarborOperator.RepoListAll("ran")
|
||||
repoListAll := DefaultHarborOperator.RepoListAll("cmii")
|
||||
|
||||
for _, repo := range repoListAll {
|
||||
repoName := strings.TrimPrefix(repo.Name, "cmii/")
|
||||
artifactListAll := DefaultHarborOperator.ArtifactListAll("cmii", repoName)
|
||||
|
||||
for _, artifact := range artifactListAll {
|
||||
//if len(artifact.Tags) == 0 {
|
||||
// fmt.Println(artifact.Digest)
|
||||
//}
|
||||
for _, tag := range artifact.Tags {
|
||||
if strings.Contains(tag.Name, "snapshot") || strings.Contains(tag.Name, "validation") || strings.Contains(tag.Name, "beta") || strings.Contains(tag.Name, "staging") || strings.Contains(tag.Name, "test") {
|
||||
fmt.Println(tag.Name)
|
||||
fmt.Println(artifact.Digest)
|
||||
fmt.Println()
|
||||
DefaultHarborOperator.ArtifactDeleteOne("cmii", repoName, artifact.Digest)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//utils.BeautifulPrint(artifactListAll)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,17 @@
|
||||
2024-07-01-18-12-13 uavcloud-demo cmii-uav-platform 5.6.0-0626 5.6.0-070101
|
||||
2024-07-01-18-19-57 uavcloud-demo cmii-uav-platform 5.6.0-070101 5.6.0-0626
|
||||
2024-07-03-11-37-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-070103 5.6.0-070301
|
||||
2024-07-11-11-33-03 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071101
|
||||
2024-07-11-11-38-04 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071101 5.6.0-sense-071001
|
||||
2024-07-11-11-39-40 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071101
|
||||
2024-07-11-11-44-41 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071101 5.6.0-sense-071001
|
||||
2024-07-11-14-08-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-sense-071001 5.6.0-071102
|
||||
2024-07-04-17-35-00 uavcloud-demo cmii-uav-platform-share 5.6.0-0704 5.6.0-070401
|
||||
2024-07-04-17-35-06 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-070301 5.6.0-070401
|
||||
2024-07-04-17-36-38 uavcloud-demo cmii-uav-platform 5.6.0-070203 5.6.0-070401
|
||||
2024-07-11-16-14-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071102 5.6.0-071103
|
||||
2024-07-11-16-39-40 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071103 5.6.0-071104
|
||||
2024-07-11-17-08-31 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071104 5.6.0-071105
|
||||
2024-07-12-09-14-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071106 5.6.0-071201
|
||||
2024-07-12-11-40-00 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071201 5.6.0-071202
|
||||
2024-07-15-10-05-51 uavcloud-demo cmii-uav-industrial-portfolio 5.6.0-071206 5.6.0-071501
|
||||
|
||||
Reference in New Issue
Block a user