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