@xfe-repo/mini-app 0.0.11 → 0.0.13
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/config/index.ts +3 -3
- package/deploy/.drone.yml +67 -80
- package/deploy/Dockerfile +1 -5
- package/deploy/helm/templates/deployment.yaml +3 -1
- package/deploy/helm/templates/svc.yaml +1 -1
- package/deploy/helm/templates/template.yaml +3 -0
- package/deploy/helm/templates/virtualService.yaml +13 -20
- package/deploy/helm/values.yaml +14 -14
- package/deploy/nginx.conf +13 -9
- package/deploy/static/9DwhwZ0Iwc.txt +1 -1
- package/dist/cli.js +314 -53
- package/dist/config.d.ts +2 -1
- package/dist/config.js +25 -1
- package/dist/preview.d.ts +7 -0
- package/dist/preview.js +347 -0
- package/dist/upload.d.ts +3 -0
- package/dist/upload.js +291 -0
- package/package.json +2 -2
- package/deploy/helm/templates/tpl.yaml +0 -3
- package/scripts/preview.js +0 -80
- package/scripts/upload.js +0 -31
package/config/index.ts
CHANGED
|
@@ -15,12 +15,12 @@ export default defineConfig<'webpack5'>(async (merge) => {
|
|
|
15
15
|
const baseConfig: UserConfigExport<'webpack5'> = {
|
|
16
16
|
projectName: 'xfe-mini',
|
|
17
17
|
date: '2024-12-3',
|
|
18
|
-
designWidth:
|
|
18
|
+
designWidth: 375,
|
|
19
19
|
deviceRatio: {
|
|
20
|
+
375: 2,
|
|
20
21
|
640: 2.34 / 2,
|
|
21
22
|
750: 1,
|
|
22
|
-
|
|
23
|
-
828: 1.81 / 2
|
|
23
|
+
828: 1.81 / 2,
|
|
24
24
|
},
|
|
25
25
|
// 项目根目录 相对于当前文件
|
|
26
26
|
sourceRoot: path.join(appProjectRootRelPath, 'src'),
|
package/deploy/.drone.yml
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# 通用 依赖安装部分
|
|
3
3
|
kind: pipeline
|
|
4
4
|
type: kubernetes
|
|
5
|
-
name:
|
|
5
|
+
name: install
|
|
6
6
|
|
|
7
7
|
metadata:
|
|
8
8
|
namespace: cicd
|
|
@@ -13,14 +13,15 @@ trigger:
|
|
|
13
13
|
- tag
|
|
14
14
|
|
|
15
15
|
steps:
|
|
16
|
-
- name:
|
|
16
|
+
- name: install
|
|
17
17
|
pull: if-not-exists
|
|
18
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-
|
|
18
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:20.17.0-pnpm
|
|
19
19
|
volumes:
|
|
20
20
|
- name: node-modules
|
|
21
21
|
path: /drone/src/node_modules
|
|
22
22
|
commands:
|
|
23
|
-
-
|
|
23
|
+
- pnpm config set registry https://registry.npmmirror.com
|
|
24
|
+
- pnpm i
|
|
24
25
|
|
|
25
26
|
volumes:
|
|
26
27
|
- name: node-modules
|
|
@@ -37,7 +38,7 @@ type: kubernetes
|
|
|
37
38
|
name: deploy-mini
|
|
38
39
|
|
|
39
40
|
depends_on:
|
|
40
|
-
-
|
|
41
|
+
- install
|
|
41
42
|
|
|
42
43
|
metadata:
|
|
43
44
|
namespace: cicd
|
|
@@ -48,7 +49,7 @@ trigger:
|
|
|
48
49
|
- tag
|
|
49
50
|
|
|
50
51
|
steps:
|
|
51
|
-
- name:
|
|
52
|
+
- name: build
|
|
52
53
|
pull: if-not-exists
|
|
53
54
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-mini:18.16.1
|
|
54
55
|
volumes:
|
|
@@ -56,7 +57,7 @@ steps:
|
|
|
56
57
|
path: /drone/src/node_modules
|
|
57
58
|
commands:
|
|
58
59
|
- GET_API_ENV=`bash deploy/env.sh` && export API_ENV=$GET_API_ENV
|
|
59
|
-
-
|
|
60
|
+
- pnpm build --type weapp
|
|
60
61
|
|
|
61
62
|
- name: preview
|
|
62
63
|
pull: if-not-exists
|
|
@@ -64,12 +65,10 @@ steps:
|
|
|
64
65
|
volumes:
|
|
65
66
|
- name: node-modules
|
|
66
67
|
path: /drone/src/node_modules
|
|
67
|
-
environment:
|
|
68
|
-
|
|
69
68
|
commands:
|
|
70
69
|
- GET_API_ENV=`bash deploy/env.sh` && export API_ENV=$GET_API_ENV
|
|
71
70
|
- echo $API_ENV $DRONE_COMMIT_MESSAGE
|
|
72
|
-
-
|
|
71
|
+
- pnpm preview -d "$API_ENV $DRONE_COMMIT_MESSAGE"
|
|
73
72
|
- echo '二维码将在2小时内过期 可在微信小程序助手中 找到此版本'
|
|
74
73
|
when:
|
|
75
74
|
ref:
|
|
@@ -85,12 +84,8 @@ steps:
|
|
|
85
84
|
commands:
|
|
86
85
|
- GET_API_ENV=`bash deploy/env.sh` && export API_ENV=$GET_API_ENV
|
|
87
86
|
- echo $API_ENV $DRONE_COMMIT_MESSAGE
|
|
88
|
-
-
|
|
87
|
+
- pnpm upload -d "$DRONE_COMMIT_MESSAGE" -v "$${DRONE_COMMIT_REF#refs/tags/}"
|
|
89
88
|
- echo '小程序已上传至微信后台 请注意及时提审'
|
|
90
|
-
- git fetch
|
|
91
|
-
- git checkout -b release $DRONE_COMMIT_REF
|
|
92
|
-
- git push origin release --force
|
|
93
|
-
- echo "release分支已强制同步到当前发布版本"
|
|
94
89
|
when:
|
|
95
90
|
ref:
|
|
96
91
|
include:
|
|
@@ -111,8 +106,7 @@ type: kubernetes
|
|
|
111
106
|
name: deploy-h5
|
|
112
107
|
|
|
113
108
|
depends_on:
|
|
114
|
-
-
|
|
115
|
-
# - deploy-mini
|
|
109
|
+
- install
|
|
116
110
|
|
|
117
111
|
metadata:
|
|
118
112
|
namespace: cicd
|
|
@@ -123,32 +117,21 @@ trigger:
|
|
|
123
117
|
- tag
|
|
124
118
|
|
|
125
119
|
steps:
|
|
126
|
-
- name:
|
|
120
|
+
- name: build
|
|
127
121
|
pull: if-not-exists
|
|
128
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-
|
|
122
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:20.17.0-pnpm
|
|
123
|
+
resources:
|
|
124
|
+
limits:
|
|
125
|
+
cpu: 2000
|
|
126
|
+
memory: 4000MiB
|
|
129
127
|
volumes:
|
|
130
128
|
- name: node-modules
|
|
131
129
|
path: /drone/src/node_modules
|
|
132
130
|
commands:
|
|
133
|
-
- export
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
pull: if-not-exists
|
|
138
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-mini:18.16.1
|
|
139
|
-
volumes:
|
|
140
|
-
- name: node-modules
|
|
141
|
-
path: /drone/src/node_modules
|
|
142
|
-
- name: node-modules-docs
|
|
143
|
-
path: /drone/src/dumi/node_modules
|
|
144
|
-
commands:
|
|
145
|
-
- cd ./dumi && yarn
|
|
146
|
-
- cd ../ && yarn docs:build
|
|
147
|
-
when:
|
|
148
|
-
ref:
|
|
149
|
-
include:
|
|
150
|
-
- refs/tags/stage-*
|
|
151
|
-
- refs/tags/release-*
|
|
131
|
+
- export REACT_APP_RELEASE=$DRONE_REPO_NAME@${DRONE_TAG:CI_COMMIT_SHA}
|
|
132
|
+
- cp -r node_modules/@xfe-repo/web-app/deploy deploy
|
|
133
|
+
- echo -n "$REACT_APP_RELEASE" > deploy/static/release
|
|
134
|
+
- pnpm build --type h5
|
|
152
135
|
|
|
153
136
|
- name: docker-build
|
|
154
137
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/deploy-cli-docker
|
|
@@ -166,78 +149,79 @@ steps:
|
|
|
166
149
|
- sh /data/scripts/builderInit.sh
|
|
167
150
|
- appName="`echo ${DRONE_REPO//\//-}`"
|
|
168
151
|
- sed -i "s/<<APP_NAME>>/$appName/g" deploy/helm/values.yaml
|
|
169
|
-
- sed -i "s/<<CI_COMMIT_SHA>>/$CI_COMMIT_SHA/g" deploy/helm/values.yaml
|
|
170
|
-
- sed -i "s/<<TAG_CONTENT>>/$DRONE_TAG/g" deploy/helm/values.yaml
|
|
171
152
|
- docker build -f deploy/Dockerfile -t xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA . --no-cache
|
|
172
153
|
- docker push xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
173
154
|
- docker rmi xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
174
155
|
|
|
175
|
-
- name: deploy
|
|
176
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
156
|
+
- name: pre-deploy
|
|
157
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
177
158
|
environment:
|
|
178
159
|
SAAS_K8S_CONFIG:
|
|
179
160
|
from_secret: saas-k8s-config
|
|
161
|
+
INFRA_K8S_CONFIG:
|
|
162
|
+
from_secret: infra-k8s-config
|
|
163
|
+
commands:
|
|
164
|
+
# 判断values.yaml中的targetK8s字段,选择目标集群
|
|
165
|
+
- export TARGET_K8S=$(cat deploy/helm/values.yaml | grep targetK8s | awk '{print $2}' | sed 's/\"//g')
|
|
166
|
+
# 将$INFRA_K8S_CONFIG或$SAAS_K8S_CONFIG写入kube_config
|
|
167
|
+
- echo "$TARGET_K8S" | grep -q "infra" && echo "$INFRA_K8S_CONFIG" > kube_config || echo "$SAAS_K8S_CONFIG" > kube_config
|
|
168
|
+
# 将环境类型写入values.yaml
|
|
169
|
+
- sed -i "s/<<CI_COMMIT_SHA>>/$CI_COMMIT_SHA/g" deploy/helm/values.yaml
|
|
170
|
+
- sed -i "s/<<TAG_CONTENT>>/$DRONE_TAG/g" deploy/helm/values.yaml
|
|
171
|
+
# 展示values.yaml 与 TARGET_K8S
|
|
172
|
+
- cat deploy/helm/values.yaml && echo $TARGET_K8S
|
|
173
|
+
|
|
174
|
+
- name: deploy-to-test
|
|
175
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
180
176
|
commands:
|
|
181
|
-
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
182
177
|
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
183
178
|
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
184
|
-
- sed -i "s/<<
|
|
179
|
+
- sed -i "s/<<APP_SUFFIX>>/-$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
185
180
|
- sed -i "s/<<HOST_PREFIX>>/$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
186
181
|
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
187
|
-
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=
|
|
182
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
188
183
|
when:
|
|
189
184
|
event:
|
|
190
185
|
- custom
|
|
191
186
|
|
|
192
187
|
- name: deploy-to-stage
|
|
193
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
194
|
-
environment:
|
|
195
|
-
SAAS_K8S_CONFIG:
|
|
196
|
-
from_secret: saas-k8s-config
|
|
188
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
197
189
|
commands:
|
|
198
|
-
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
199
190
|
- cp deploy/helm/values.yaml deploy/helm/values.stage.yaml
|
|
200
191
|
- sed -i "s/<<ENV_TYPE>>/stage/g" deploy/helm/values.stage.yaml
|
|
201
|
-
- sed -i "s/<<
|
|
202
|
-
- sed -i "s/<<HOST_PREFIX
|
|
192
|
+
- sed -i "s/<<APP_SUFFIX>>//g" deploy/helm/values.stage.yaml
|
|
193
|
+
- sed -i "s/<<HOST_PREFIX>>//g" deploy/helm/values.stage.yaml
|
|
203
194
|
- helm template deploy/helm --values deploy/helm/values.stage.yaml
|
|
204
|
-
- helm template deploy/helm --values deploy/helm/values.stage.yaml | kubectl --kubeconfig=
|
|
195
|
+
- helm template deploy/helm --values deploy/helm/values.stage.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
205
196
|
when:
|
|
206
197
|
ref:
|
|
207
198
|
include:
|
|
208
199
|
- refs/tags/stage-*
|
|
209
200
|
|
|
210
|
-
- name: deploy-to-
|
|
211
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
212
|
-
environment:
|
|
213
|
-
SAAS_K8S_CONFIG:
|
|
214
|
-
from_secret: saas-k8s-config
|
|
201
|
+
- name: deploy-to-prod
|
|
202
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
215
203
|
commands:
|
|
216
|
-
-
|
|
217
|
-
-
|
|
218
|
-
- sed -i "s/<<
|
|
219
|
-
- sed -i "s/<<
|
|
220
|
-
-
|
|
221
|
-
- helm template deploy/helm --values deploy/helm/values.
|
|
222
|
-
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
204
|
+
- cp deploy/helm/values.yaml deploy/helm/values.prod.yaml
|
|
205
|
+
- sed -i "s/<<ENV_TYPE>>/prod/g" deploy/helm/values.prod.yaml
|
|
206
|
+
- sed -i "s/<<APP_SUFFIX>>//g" deploy/helm/values.prod.yaml
|
|
207
|
+
- sed -i "s/<<HOST_PREFIX>>//g" deploy/helm/values.prod.yaml
|
|
208
|
+
- helm template deploy/helm --values deploy/helm/values.prod.yaml
|
|
209
|
+
- helm template deploy/helm --values deploy/helm/values.prod.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
223
210
|
when:
|
|
224
211
|
ref:
|
|
225
212
|
include:
|
|
226
213
|
- refs/tags/release-*
|
|
227
214
|
|
|
228
|
-
- name: deploy-to-
|
|
229
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
230
|
-
|
|
231
|
-
SAAS_K8S_CONFIG:
|
|
232
|
-
from_secret: saas-k8s-config
|
|
215
|
+
- name: deploy-to-stable
|
|
216
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
217
|
+
failure: ignore
|
|
233
218
|
commands:
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
- sed -i "s/<<
|
|
237
|
-
- sed -i "s/<<
|
|
238
|
-
-
|
|
239
|
-
- helm template deploy/helm --values deploy/helm/values.
|
|
240
|
-
- helm template deploy/helm --values deploy/helm/values.prod.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
219
|
+
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
220
|
+
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
221
|
+
- sed -i "s/<<APP_SUFFIX>>/-stable/g" deploy/helm/values.test.yaml
|
|
222
|
+
- sed -i "s/<<HOST_PREFIX>>/*/g" deploy/helm/values.test.yaml
|
|
223
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
224
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=kube_config apply -f -
|
|
241
225
|
when:
|
|
242
226
|
ref:
|
|
243
227
|
include:
|
|
@@ -253,9 +237,6 @@ volumes:
|
|
|
253
237
|
- name: node-modules
|
|
254
238
|
host:
|
|
255
239
|
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules
|
|
256
|
-
- name: node-modules-docs
|
|
257
|
-
host:
|
|
258
|
-
path: /var/lib/node/${DRONE_REPO_NAME}-node-modules-dumi-docs
|
|
259
240
|
|
|
260
241
|
image_pull_secrets:
|
|
261
242
|
- docker-key
|
|
@@ -268,6 +249,12 @@ get:
|
|
|
268
249
|
name: config
|
|
269
250
|
---
|
|
270
251
|
kind: secret
|
|
252
|
+
name: infra-k8s-config
|
|
253
|
+
get:
|
|
254
|
+
path: infra-k8s-config
|
|
255
|
+
name: config
|
|
256
|
+
---
|
|
257
|
+
kind: secret
|
|
271
258
|
name: ssh-key
|
|
272
259
|
get:
|
|
273
260
|
path: deployer-ssh-key
|
package/deploy/Dockerfile
CHANGED
|
@@ -2,13 +2,9 @@ FROM xhj-prod-registry.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/nginx-base
|
|
|
2
2
|
|
|
3
3
|
WORKDIR /code/www/deploy/webroot/app/current
|
|
4
4
|
|
|
5
|
-
COPY build/
|
|
5
|
+
COPY build/client ./
|
|
6
6
|
|
|
7
7
|
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
8
8
|
|
|
9
9
|
# 拷贝静态文件
|
|
10
10
|
COPY deploy/static ./
|
|
11
|
-
|
|
12
|
-
# 拷贝docs文档文件
|
|
13
|
-
# https://cloud.tencent.com/developer/ask/sof/108832342
|
|
14
|
-
COPY build/doc[s] ./docs
|
|
@@ -2,7 +2,7 @@ apiVersion: apps/v1
|
|
|
2
2
|
kind: Deployment
|
|
3
3
|
metadata:
|
|
4
4
|
name: {{ $.Values.app }}
|
|
5
|
-
namespace: {{ include "
|
|
5
|
+
namespace: {{ include "template.namespace" . }}
|
|
6
6
|
annotations:
|
|
7
7
|
kubernetes.io/change-cause: {{ or $.Values.tagContent $.Values.commitSHA }}
|
|
8
8
|
spec:
|
|
@@ -35,9 +35,11 @@ spec:
|
|
|
35
35
|
- name: HOST_PREFIX
|
|
36
36
|
value: "{{ $.Values.hostPrefix }}"
|
|
37
37
|
{{end}}
|
|
38
|
+
{{- if eq $.Values.targetK8s "saas" }}
|
|
38
39
|
envFrom:
|
|
39
40
|
- configMapRef:
|
|
40
41
|
name: "app-common-config"
|
|
42
|
+
{{- end }}
|
|
41
43
|
volumeMounts:
|
|
42
44
|
- mountPath: /var/log/nginx
|
|
43
45
|
subPath: "xfe/{{ $.Values.app }}"
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
+
{{- if .Values.virtualService.enabled }}
|
|
1
2
|
apiVersion: networking.istio.io/v1alpha3
|
|
2
3
|
kind: VirtualService
|
|
3
4
|
metadata:
|
|
4
|
-
name: {{
|
|
5
|
-
namespace: {{ include "
|
|
5
|
+
name: {{ .Values.app }}-vs
|
|
6
|
+
namespace: {{ include "template.namespace" . }}
|
|
6
7
|
spec:
|
|
7
8
|
hosts:
|
|
8
|
-
{{- $host := (get
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
{{- $host := (get .Values.virtualService.hosts .Values.envType) }}
|
|
10
|
+
{{- range $host }}
|
|
11
|
+
- "{{ . }}"
|
|
12
|
+
{{- end }}
|
|
12
13
|
gateways:
|
|
13
|
-
{{-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
{{- $gateways := .Values.virtualService.gateways }}
|
|
15
|
+
{{- range $gateways }}
|
|
16
|
+
- "{{ . }}"
|
|
17
|
+
{{- end }}
|
|
16
18
|
http:
|
|
17
|
-
{{ range $.Values.matchRedirect }}
|
|
18
|
-
- match:
|
|
19
|
-
- uri:
|
|
20
|
-
exact: {{ .from }}
|
|
21
|
-
redirect:
|
|
22
|
-
uri: {{ .to }}
|
|
23
|
-
{{- $host := (get $.Values.hosts $.Values.envType) }}
|
|
24
|
-
authority: "{{ index $host 0 }}"
|
|
25
|
-
{{- end }}
|
|
26
19
|
- match:
|
|
27
20
|
- uri:
|
|
28
21
|
prefix: /
|
|
29
22
|
route:
|
|
30
23
|
- destination:
|
|
31
|
-
host: {{
|
|
24
|
+
host: {{ .Values.app }}
|
|
32
25
|
port:
|
|
33
26
|
number: 80
|
|
34
27
|
corsPolicy:
|
|
@@ -36,4 +29,4 @@ spec:
|
|
|
36
29
|
- "*"
|
|
37
30
|
allowMethods:
|
|
38
31
|
- "*"
|
|
39
|
-
|
|
32
|
+
{{- end }}
|
package/deploy/helm/values.yaml
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
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>>'
|
|
6
6
|
envType: '<<ENV_TYPE>>'
|
|
7
7
|
hostPrefix: '<<HOST_PREFIX>>'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
namespace: ''
|
|
9
|
+
virtualService:
|
|
10
|
+
enabled: true
|
|
11
|
+
hosts:
|
|
12
|
+
test:
|
|
13
|
+
- '<<HOST_PREFIX>>.exam.t.eshetang.com'
|
|
14
|
+
stage:
|
|
15
|
+
- 'stage.exam.t.eshetang.com'
|
|
16
|
+
prod:
|
|
17
|
+
- 'exam.eshetang.com'
|
|
18
|
+
gateways:
|
|
19
|
+
- 'common-gateway-eshetang'
|
|
20
|
+
targetK8s: 'saas'
|
package/deploy/nginx.conf
CHANGED
|
@@ -17,24 +17,28 @@ server {
|
|
|
17
17
|
|
|
18
18
|
set $file /index.html;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
try_files $uri $uri/ $file;
|
|
20
|
+
# 屏蔽掉map文件
|
|
21
|
+
location ~ .*\.map {
|
|
22
|
+
return 404;
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
location
|
|
25
|
+
location /check-update {
|
|
26
|
+
add_header Cache-control no-cache;
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
try_files /release =404;
|
|
29
|
+
}
|
|
29
30
|
|
|
30
|
-
#
|
|
31
|
-
location
|
|
32
|
-
|
|
31
|
+
# 兼容v2版本的静态资源
|
|
32
|
+
location /v2/static {
|
|
33
|
+
rewrite /v2(.*) $1 break;
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
location / {
|
|
36
37
|
try_files $uri $file;
|
|
37
38
|
|
|
39
|
+
# 兼容微前端 允许跨域
|
|
40
|
+
add_header 'Access-Control-Allow-Origin' '*';
|
|
41
|
+
|
|
38
42
|
add_header Cache-Control no-cache;
|
|
39
43
|
add_header Set-Cookie "apiEnv=${apiEnv}; Max-Age=2626560; Path=/;";
|
|
40
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
a20aacdde689e014f54b1812a0a5a320
|
|
1
|
+
a20aacdde689e014f54b1812a0a5a320
|