weverse-ui/.drone.yml
liukang b9240fa75b
All checks were successful
continuous-integration/drone Build is passing
部署
2025-02-12 09:05:08 +08:00

36 lines
1.5 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline # 定义对象类型还有secret和signature两种类型
type: docker # 定义流水线类型还有kubernetes、exec、ssh等类型
name: weverse-ui # 定义流水线名称
steps: # 定义流水线执行步骤,这些步骤将顺序执行
- name: package # 1. 流水线名称npm打包
pull: if-not-exists
image: node:20.10.0 # 定义创建容器的Docker镜像
volumes: # 将容器内目录挂载到宿主机仓库需要开启Trusted设置
# 挂载宿主机的目录
- name: npm-build
path: /drone/src/weverse-ui-build # 将应用打包好的Jar和执行脚本挂载出来
commands: # 定义在Docker容器中执行的shell命令,这里是复制到npm镜像容器里面的区分开项目就行了
- npm config set registry http://registry.npm.taobao.org
- npm install
- npm run build:prod
- cp -r /drone/src/weverse-ui/* /drone/src/weverse-ui-build
# - name: notify # 3. 通知(这里使用了钉钉通知,可以使用微信通知、邮件通知等)
# pull: if-not-exists
# image: guoxudongdocker/drone-dingtalk:latest
# settings:
# token:
# from_secret: dingtalk_token
# type: markdown
# message_color: true
# message_pic: true
# sha_link: true
# when:
# status: [failure, success]
volumes: # 定义流水线挂载目录,用于共享数据
- name: npm-build
host:
path: /home/d1/node/build/weverse-ui # 从宿主机中挂载的目录