@xfe-repo/web-app 1.0.2 → 1.0.4
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 +74 -34
- package/package.json +2 -2
package/deploy/.drone.yml
CHANGED
|
@@ -11,50 +11,35 @@ trigger:
|
|
|
11
11
|
- tag
|
|
12
12
|
|
|
13
13
|
steps:
|
|
14
|
-
- name:
|
|
14
|
+
- name: install
|
|
15
15
|
pull: if-not-exists
|
|
16
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:16.
|
|
16
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm
|
|
17
17
|
volumes:
|
|
18
18
|
- name: node-modules
|
|
19
19
|
path: /drone/src/node_modules
|
|
20
20
|
commands:
|
|
21
|
-
-
|
|
22
|
-
-
|
|
21
|
+
- pnpm config set registry https://registry.npmmirror.com
|
|
22
|
+
- pnpm i --frozen-lockfile
|
|
23
|
+
- cp -r node_modules/@xfe-repo/web-app/deploy deploy
|
|
23
24
|
|
|
24
|
-
- name:
|
|
25
|
+
- name: build
|
|
25
26
|
pull: if-not-exists
|
|
26
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:16.
|
|
27
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:18.16.1-pnpm
|
|
28
|
+
resources:
|
|
29
|
+
limits:
|
|
30
|
+
cpu: 2000
|
|
31
|
+
memory: 4000MiB
|
|
27
32
|
volumes:
|
|
28
33
|
- name: node-modules
|
|
29
34
|
path: /drone/src/node_modules
|
|
30
35
|
commands:
|
|
31
36
|
- export REACT_APP_RELEASE=$DRONE_REPO_NAME@${DRONE_TAG:CI_COMMIT_SHA}
|
|
32
37
|
- echo -n "$REACT_APP_RELEASE" > deploy/static/release
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
- name: sentry-upload
|
|
36
|
-
failure: ignore
|
|
37
|
-
pull: if-not-exists
|
|
38
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/node-base:16.13.2
|
|
39
|
-
volumes:
|
|
40
|
-
- name: node-modules
|
|
41
|
-
path: /drone/src/node_modules
|
|
42
|
-
commands:
|
|
43
|
-
- yarn sentry-upload -r $(cat deploy/static/release)
|
|
44
|
-
when:
|
|
45
|
-
ref:
|
|
46
|
-
include:
|
|
47
|
-
- refs/tags/release-*
|
|
48
|
-
- refs/tags/stage-*
|
|
38
|
+
- pnpm build
|
|
49
39
|
|
|
50
40
|
- name: docker-build
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
volumes:
|
|
54
|
-
- name: socks
|
|
55
|
-
path: /var/run
|
|
56
|
-
- name: docker
|
|
57
|
-
path: /var/lib/docker
|
|
41
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/deploy-cli-docker
|
|
42
|
+
privileged: true
|
|
58
43
|
environment:
|
|
59
44
|
SSH_KEY:
|
|
60
45
|
from_secret: ssh-key
|
|
@@ -63,7 +48,9 @@ steps:
|
|
|
63
48
|
DEPLOY_GO_CONFIG:
|
|
64
49
|
from_secret: deploy-go-config
|
|
65
50
|
commands:
|
|
66
|
-
-
|
|
51
|
+
- /usr/local/bin/dockerd-entrypoint.sh 2>&1 >> /dev/null &
|
|
52
|
+
- sleep 5
|
|
53
|
+
- sh /data/scripts/builderInit.sh
|
|
67
54
|
- appName="`echo ${DRONE_REPO//\//-}`"
|
|
68
55
|
- sed -i "s/<<APP_NAME>>/$appName/g" deploy/helm/values.yaml
|
|
69
56
|
- sed -i "s/<<CI_COMMIT_SHA>>/$CI_COMMIT_SHA/g" deploy/helm/values.yaml
|
|
@@ -72,11 +59,46 @@ steps:
|
|
|
72
59
|
- docker push xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
73
60
|
- docker rmi xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
74
61
|
|
|
62
|
+
- name: deploy-to-test
|
|
63
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
64
|
+
environment:
|
|
65
|
+
SAAS_K8S_CONFIG:
|
|
66
|
+
from_secret: saas-k8s-config
|
|
67
|
+
commands:
|
|
68
|
+
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
69
|
+
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
70
|
+
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
71
|
+
- sed -i "s/<<APP_PREFIX>>/-$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
72
|
+
- sed -i "s/<<HOST_PREFIX>>/$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
73
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
74
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
75
|
+
when:
|
|
76
|
+
event:
|
|
77
|
+
- custom
|
|
78
|
+
|
|
79
|
+
- name: deploy-to-stage
|
|
80
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
81
|
+
environment:
|
|
82
|
+
SAAS_K8S_CONFIG:
|
|
83
|
+
from_secret: saas-k8s-config
|
|
84
|
+
commands:
|
|
85
|
+
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
86
|
+
- cp deploy/helm/values.yaml deploy/helm/values.stage.yaml
|
|
87
|
+
- sed -i "s/<<ENV_TYPE>>/stage/g" deploy/helm/values.stage.yaml
|
|
88
|
+
- sed -i "s/<<APP_PREFIX>>//g" deploy/helm/values.stage.yaml
|
|
89
|
+
- sed -i "s/<<HOST_PREFIX>>//g" deploy/helm/values.stage.yaml
|
|
90
|
+
- helm template deploy/helm --values deploy/helm/values.stage.yaml
|
|
91
|
+
- helm template deploy/helm --values deploy/helm/values.stage.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
92
|
+
when:
|
|
93
|
+
ref:
|
|
94
|
+
include:
|
|
95
|
+
- refs/tags/stage-*
|
|
96
|
+
|
|
75
97
|
- name: deploy-to-prod
|
|
76
|
-
image:
|
|
98
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
77
99
|
environment:
|
|
78
100
|
SAAS_K8S_CONFIG:
|
|
79
|
-
from_secret:
|
|
101
|
+
from_secret: saas-k8s-config
|
|
80
102
|
commands:
|
|
81
103
|
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
82
104
|
- cp deploy/helm/values.yaml deploy/helm/values.prod.yaml
|
|
@@ -90,6 +112,24 @@ steps:
|
|
|
90
112
|
include:
|
|
91
113
|
- refs/tags/release-*
|
|
92
114
|
|
|
115
|
+
- name: deploy-to-stable
|
|
116
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
117
|
+
environment:
|
|
118
|
+
SAAS_K8S_CONFIG:
|
|
119
|
+
from_secret: saas-k8s-config
|
|
120
|
+
commands:
|
|
121
|
+
- echo "$SAAS_K8S_CONFIG" > saas_config
|
|
122
|
+
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
123
|
+
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
124
|
+
- sed -i "s/<<APP_PREFIX>>/-stable/g" deploy/helm/values.test.yaml
|
|
125
|
+
- sed -i "s/<<HOST_PREFIX>>/*/g" deploy/helm/values.test.yaml
|
|
126
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml
|
|
127
|
+
- helm template deploy/helm --values deploy/helm/values.test.yaml | kubectl --kubeconfig=saas_config apply -f -
|
|
128
|
+
when:
|
|
129
|
+
ref:
|
|
130
|
+
include:
|
|
131
|
+
- refs/tags/release-*
|
|
132
|
+
|
|
93
133
|
volumes:
|
|
94
134
|
- name: socks
|
|
95
135
|
host:
|
|
@@ -106,9 +146,9 @@ image_pull_secrets:
|
|
|
106
146
|
|
|
107
147
|
---
|
|
108
148
|
kind: secret
|
|
109
|
-
name:
|
|
149
|
+
name: saas-k8s-config
|
|
110
150
|
get:
|
|
111
|
-
path:
|
|
151
|
+
path: saas-k8s-config
|
|
112
152
|
name: config
|
|
113
153
|
---
|
|
114
154
|
kind: secret
|
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.4",
|
|
4
4
|
"bin": {
|
|
5
5
|
"xfe-web": "./bin/index.js"
|
|
6
6
|
},
|
|
@@ -74,6 +74,6 @@
|
|
|
74
74
|
"workbox-webpack-plugin": "^7.0.0",
|
|
75
75
|
"yaml": "^2.3.4",
|
|
76
76
|
"@xfe-repo/eslint-config": "0.0.1",
|
|
77
|
-
"@xfe-repo/typescript-config": "0.0.
|
|
77
|
+
"@xfe-repo/typescript-config": "0.0.3"
|
|
78
78
|
}
|
|
79
79
|
}
|