@xfe-repo/mini-app 0.1.0 → 0.1.2
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 +33 -31
- package/package.json +1 -1
package/deploy/.drone.yml
CHANGED
|
@@ -134,25 +134,21 @@ steps:
|
|
|
134
134
|
- echo -n "$REACT_APP_RELEASE" > deploy/static/release
|
|
135
135
|
- pnpm build --type h5
|
|
136
136
|
|
|
137
|
-
- name:
|
|
138
|
-
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- sed -i "s/<<APP_NAME>>/$appName/g" deploy/helm/values.yaml
|
|
153
|
-
- docker build -f deploy/Dockerfile -t xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA . --no-cache
|
|
154
|
-
- docker push xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
155
|
-
- docker rmi xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/$$appName:$$CI_COMMIT_SHA
|
|
137
|
+
- name: image-build
|
|
138
|
+
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/image-common/kaniko:latest
|
|
139
|
+
pull: always
|
|
140
|
+
settings:
|
|
141
|
+
registry: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com
|
|
142
|
+
username:
|
|
143
|
+
from_secret: username
|
|
144
|
+
password:
|
|
145
|
+
from_secret: password
|
|
146
|
+
dockerfile: deploy/Dockerfile
|
|
147
|
+
repo_path: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image/
|
|
148
|
+
repo_name: ${DRONE_REPO}
|
|
149
|
+
tags:
|
|
150
|
+
- ${CI_COMMIT_SHA}
|
|
151
|
+
- latest
|
|
156
152
|
|
|
157
153
|
- name: pre-deploy
|
|
158
154
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
@@ -175,17 +171,17 @@ steps:
|
|
|
175
171
|
- name: deploy-to-test
|
|
176
172
|
image: xhj-prod-registry-vpc.cn-hangzhou.cr.aliyuncs.com/xhj-image-common/deploy-helm:latest
|
|
177
173
|
commands:
|
|
174
|
+
- export KUBECONFIG=$PWD/kube_config
|
|
178
175
|
- cp deploy/helm/values.yaml deploy/helm/values.test.yaml
|
|
179
176
|
- sed -i "s/<<ENV_TYPE>>/test/g" deploy/helm/values.test.yaml
|
|
180
177
|
- sed -i "s/<<APP_SUFFIX>>/-$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
181
178
|
- sed -i "s/<<HOST_PREFIX>>/$HOST_PREFIX/g" deploy/helm/values.test.yaml
|
|
182
|
-
-
|
|
179
|
+
- appName="`echo ${DRONE_REPO//\//-}`"
|
|
180
|
+
- chartName="$appName-$HOST_PREFIX"
|
|
181
|
+
- echo "$chartName"
|
|
182
|
+
- sed -i "s/deployment/$chartName/g" deploy/helm/Chart.yaml
|
|
183
183
|
- sed -i "s/1.0.0/0.0.0-$CI_COMMIT_SHA/g" deploy/helm/Chart.yaml
|
|
184
|
-
- helm upgrade --install "$
|
|
185
|
-
-f deploy/helm/values.test.yaml \
|
|
186
|
-
--namespace deployment-test \
|
|
187
|
-
--create-namespace \
|
|
188
|
-
--history-max 5 \
|
|
184
|
+
- helm upgrade --install "$chartName" deploy/helm -f deploy/helm/values.test.yaml --namespace deployment-test --create-namespace --history-max 5
|
|
189
185
|
when:
|
|
190
186
|
event:
|
|
191
187
|
- custom
|
|
@@ -261,13 +257,19 @@ get:
|
|
|
261
257
|
name: config
|
|
262
258
|
---
|
|
263
259
|
kind: secret
|
|
264
|
-
name: ssh-key
|
|
265
|
-
get:
|
|
266
|
-
path: deployer-ssh-key
|
|
267
|
-
name: id_rsa
|
|
268
|
-
---
|
|
269
|
-
kind: secret
|
|
270
260
|
name: docker-key
|
|
271
261
|
get:
|
|
272
262
|
path: docker-key
|
|
273
263
|
name: config
|
|
264
|
+
---
|
|
265
|
+
kind: secret
|
|
266
|
+
name: username
|
|
267
|
+
get:
|
|
268
|
+
path: docker-auth
|
|
269
|
+
name: username
|
|
270
|
+
---
|
|
271
|
+
kind: secret
|
|
272
|
+
name: password
|
|
273
|
+
get:
|
|
274
|
+
path: docker-auth
|
|
275
|
+
name: password
|