2024-09-13 19:26:40 +00:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: build
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
2024-10-22 07:12:05 +00:00
|
|
|
image: docker.linbin.site/node:18.20.3-alpine
|
2024-09-13 19:26:40 +00:00
|
|
|
pull: if-not-exists
|
|
|
|
volumes:
|
|
|
|
- name: cache
|
|
|
|
path: /drone/src/.pnpm-store
|
|
|
|
- name: node-build
|
|
|
|
path: /app/build
|
|
|
|
commands: ## 此处自己定义项目工程的构建命令
|
2024-10-22 07:12:05 +00:00
|
|
|
- npm install -g pnpm --registry=https://registry.npmmirror.com
|
|
|
|
- pnpm config set registry https://registry.npmmirror.com
|
2024-09-13 19:26:40 +00:00
|
|
|
- pnpm i
|
|
|
|
- pnpm run build:prod
|
|
|
|
- ls -l
|
|
|
|
- cp -r dist /app/build/
|
|
|
|
when: ## 定义在什么情况下触发构建任务
|
|
|
|
branch: master #定义在哪个分支触发构建任务
|
2024-10-22 07:12:05 +00:00
|
|
|
# - name: scp
|
|
|
|
# image: appleboy/drone-scp
|
|
|
|
# volumes:
|
|
|
|
# - name: node-build
|
|
|
|
# path: /app/build
|
|
|
|
# settings:
|
|
|
|
# host: 60.204.138.3
|
|
|
|
# username: root
|
|
|
|
# password: 5xhqamyZ
|
|
|
|
# port: 22
|
|
|
|
# target: /data/app/dmjs-merchant-admin
|
|
|
|
# source: /app/build/dist
|
|
|
|
# overwrite: true
|
2024-09-13 19:26:40 +00:00
|
|
|
volumes:
|
|
|
|
- name: node-build
|
|
|
|
host:
|
|
|
|
path: /data/app/dmjs-merchant-admin
|