@xfe-repo/web-app 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/deploy/.drone.yml +24 -28
- package/deploy/helm/values.yaml +1 -1
- package/package.json +3 -3
package/deploy/.drone.yml
CHANGED
|
@@ -14,7 +14,7 @@ trigger:
|
|
|
14
14
|
steps:
|
|
15
15
|
- name: install
|
|
16
16
|
pull: if-not-exists
|
|
17
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm
|
|
17
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm-9
|
|
18
18
|
volumes:
|
|
19
19
|
- name: node-modules
|
|
20
20
|
path: /drone/src/node_modules
|
|
@@ -24,7 +24,7 @@ steps:
|
|
|
24
24
|
|
|
25
25
|
- name: build
|
|
26
26
|
pull: if-not-exists
|
|
27
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm
|
|
27
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm-9
|
|
28
28
|
resources:
|
|
29
29
|
limits:
|
|
30
30
|
cpu: 2000
|
|
@@ -54,22 +54,35 @@ steps:
|
|
|
54
54
|
- sh /data/scripts/builderInit.sh
|
|
55
55
|
- appName="`echo ${DRONE_REPO//\//-}`"
|
|
56
56
|
- sed -i "s/<<APP_NAME>>/$appName/g" deploy/helm/values.yaml
|
|
57
|
-
- sed -i "s/<<CI_COMMIT_SHA>>/$CI_COMMIT_SHA/g" deploy/helm/values.yaml
|
|
58
|
-
- sed -i "s/<<TAG_CONTENT>>/$DRONE_TAG/g" deploy/helm/values.yaml
|
|
59
57
|
- docker build -f deploy/Dockerfile -t xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA . --no-cache
|
|
60
58
|
- docker push xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
61
59
|
- docker rmi xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
62
60
|
|
|
63
|
-
- name: deploy
|
|
61
|
+
- name: pre-deploy
|
|
64
62
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
65
63
|
environment:
|
|
66
64
|
SAAS_K8S_CONFIG:
|
|
67
65
|
from_secret: saas-k8s-config
|
|
66
|
+
INFRA_K8S_CONFIG:
|
|
67
|
+
from_secret: infra-k8s-config
|
|
68
|
+
commands:
|
|
69
|
+
# 判断values.yaml中的targetK8s字段,选择目标集群
|
|
70
|
+
- export TARGET_K8S=$(cat deploy/helm/values.yaml | grep targetK8s | awk '{print $2}' | sed 's/\"//g')
|
|
71
|
+
# 将$INFRA_K8S_CONFIG或$SAAS_K8S_CONFIG写入kube_config
|
|
72
|
+
- echo "$TARGET_K8S" | grep -q "infra" && echo "$INFRA_K8S_CONFIG" > kube_config || echo "$SAAS_K8S_CONFIG" > kube_config
|
|
73
|
+
# 将环境类型写入values.yaml
|
|
74
|
+
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.yaml
|
|
75
|
+
- sed -i "s/<<CI_COMMIT_SHA>>/$CI_COMMIT_SHA/g" deploy/helm/values.yaml
|
|
76
|
+
- sed -i "s/<<TAG_CONTENT>>/$DRONE_TAG/g" deploy/helm/values.yaml
|
|
77
|
+
# 展示values.yaml 与 TARGET_K8S
|
|
78
|
+
- cat deploy/helm/values.yaml && echo $TARGET_K8S
|
|
79
|
+
|
|
80
|
+
- name: deploy-to-test
|
|
81
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
68
82
|
commands:
|
|
69
|
-
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
70
83
|
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
71
84
|
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
72
|
-
- sed -i "s/<<
|
|
85
|
+
- sed -i "s/<<APP_SUFFIX>>/-$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
73
86
|
- sed -i "s/<<HOST_PREFIX>>/$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
74
87
|
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
75
88
|
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
@@ -79,17 +92,13 @@ steps:
|
|
|
79
92
|
|
|
80
93
|
- name: deploy-to-stage
|
|
81
94
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
82
|
-
environment:
|
|
83
|
-
SAAS_K8S_CONFIG:
|
|
84
|
-
from_secret: saas-k8s-config
|
|
85
95
|
commands:
|
|
86
|
-
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
87
96
|
- cp deploy/helm/values.yaml deploy/helm/values.stage.yaml
|
|
88
97
|
- sed -i "s/<<ENV_TYPE>>/stage/g" deploy/helm/values.stage.yaml
|
|
89
|
-
- sed -i "s/<<
|
|
98
|
+
- sed -i "s/<<APP_SUFFIX>>//g" deploy/helm/values.stage.yaml
|
|
90
99
|
- sed -i "s/<<HOST_PREFIX>>//g" deploy/helm/values.stage.yaml
|
|
91
100
|
- helm template deploy/helm --values deploy/helm/values.stage.yaml
|
|
92
|
-
- helm template deploy/helm --values deploy/helm/values.stage.yaml | kubectl --kubeconfig=
|
|
101
|
+
- helm template deploy/helm --values deploy/helm/values.stage.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
93
102
|
when:
|
|
94
103
|
ref:
|
|
95
104
|
include:
|
|
@@ -97,19 +106,10 @@ steps:
|
|
|
97
106
|
|
|
98
107
|
- name: deploy-to-prod
|
|
99
108
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
100
|
-
environment:
|
|
101
|
-
SAAS_K8S_CONFIG:
|
|
102
|
-
from_secret: saas-k8s-config
|
|
103
|
-
INFRA_K8S_CONFIG:
|
|
104
|
-
from_secret: infra-k8s-config
|
|
105
109
|
commands:
|
|
106
|
-
# 判断values.yaml中的targetK8s字段,选择目标集群
|
|
107
|
-
- export TARGET_K8S=$(cat deploy/helm/values.yaml | grep targetK8s | awk '{print $2}' | sed 's/\"//g')
|
|
108
|
-
# 将$INFRA_K8S_CONFIG或$SAAS_K8S_CONFIG写入kube_config
|
|
109
|
-
- echo "$TARGET_K8S" | grep -q "infra" && echo "$INFRA_K8S_CONFIG" > kube_config || echo "$SAAS_K8S_CONFIG" > kube_config
|
|
110
110
|
- cp deploy/helm/values.yaml deploy/helm/values.prod.yaml
|
|
111
111
|
- sed -i "s/<<ENV_TYPE>>/prod/g" deploy/helm/values.prod.yaml
|
|
112
|
-
- sed -i "s/<<
|
|
112
|
+
- sed -i "s/<<APP_SUFFIX>>//g" deploy/helm/values.prod.yaml
|
|
113
113
|
- sed -i "s/<<HOST_PREFIX>>//g" deploy/helm/values.prod.yaml
|
|
114
114
|
- helm template deploy/helm --values deploy/helm/values.prod.yaml
|
|
115
115
|
- helm template deploy/helm --values deploy/helm/values.prod.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
@@ -121,14 +121,10 @@ steps:
|
|
|
121
121
|
- name: deploy-to-stable
|
|
122
122
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
123
123
|
failure: ignore
|
|
124
|
-
environment:
|
|
125
|
-
SAAS_K8S_CONFIG:
|
|
126
|
-
from_secret: saas-k8s-config
|
|
127
124
|
commands:
|
|
128
|
-
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
129
125
|
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
130
126
|
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
131
|
-
- sed -i "s/<<
|
|
127
|
+
- sed -i "s/<<APP_SUFFIX>>/-stable/g" deploy/helm/values.test.yaml
|
|
132
128
|
- sed -i "s/<<HOST_PREFIX>>/*/g" deploy/helm/values.test.yaml
|
|
133
129
|
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
134
130
|
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=saas_config apply -f -
|
package/deploy/helm/values.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
imagePullSecret: 'docker-image-cr-pull-vpc'
|
|
2
|
-
app: '<<APP_NAME>><<
|
|
2
|
+
app: '<<APP_NAME>><<APP_SUFFIX>>'
|
|
3
3
|
image: 'xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/<<APP_NAME>>:<<CI_COMMIT_SHA>>'
|
|
4
4
|
tagContent: '<<TAG_CONTENT>>'
|
|
5
5
|
commitSHA: '<<CI_COMMIT_SHA>>'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfe-repo/web-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xfe-web": "./bin/index.js"
|
|
6
6
|
},
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"webpack-manifest-plugin": "^4.0.2",
|
|
74
74
|
"workbox-webpack-plugin": "^7.0.0",
|
|
75
75
|
"yaml": "^2.3.4",
|
|
76
|
-
"@xfe-repo/
|
|
77
|
-
"@xfe-repo/
|
|
76
|
+
"@xfe-repo/typescript-config": "0.0.3",
|
|
77
|
+
"@xfe-repo/eslint-config": "0.0.2"
|
|
78
78
|
}
|
|
79
79
|
}
|