2023-03-05 17:17:04 +08:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-03-06 10:06:47 +08:00
|
|
|
type: docker
|
2023-03-20 09:49:00 +08:00
|
|
|
name: backset.cn ci
|
2023-03-05 17:17:04 +08:00
|
|
|
|
2023-03-06 13:12:33 +08:00
|
|
|
volumes:
|
|
|
|
- name: node_modules
|
|
|
|
host:
|
|
|
|
path: /home/drone/cache/node_modules
|
|
|
|
|
2023-03-05 17:17:04 +08:00
|
|
|
steps:
|
2023-03-20 09:49:00 +08:00
|
|
|
# web端
|
2023-03-06 13:15:34 +08:00
|
|
|
- name: build-web
|
2023-03-06 10:06:47 +08:00
|
|
|
image: node:16.19-alpine
|
2023-03-06 13:12:33 +08:00
|
|
|
# 容器内挂载点
|
2023-03-06 11:01:56 +08:00
|
|
|
volumes:
|
2023-03-06 13:33:38 +08:00
|
|
|
- name: node_modules
|
2023-03-06 13:20:35 +08:00
|
|
|
path: /drone/src/node_modules
|
2023-03-06 10:05:46 +08:00
|
|
|
commands:
|
2023-03-06 13:12:33 +08:00
|
|
|
- pwd
|
2023-03-06 10:06:47 +08:00
|
|
|
- node -v
|
|
|
|
- npm -v
|
2023-03-06 13:31:33 +08:00
|
|
|
- npm install -g pnpm
|
2023-03-20 09:52:19 +08:00
|
|
|
- pnpm i
|
2023-03-06 13:31:33 +08:00
|
|
|
- pnpm build:web
|
2023-03-06 11:01:56 +08:00
|
|
|
|
2023-03-06 13:15:34 +08:00
|
|
|
- name: deploy-web
|
2023-03-06 13:23:40 +08:00
|
|
|
image: appleboy/drone-scp:1.6
|
2023-03-06 13:12:33 +08:00
|
|
|
settings:
|
2023-03-06 13:30:38 +08:00
|
|
|
host:
|
|
|
|
- backset.cn
|
2023-03-06 13:12:33 +08:00
|
|
|
username: root
|
|
|
|
password: cr654654.
|
|
|
|
port: 22
|
2023-03-06 13:30:38 +08:00
|
|
|
overwrite: true
|
|
|
|
command_timeout: 2m
|
2023-03-06 13:12:33 +08:00
|
|
|
target: /www/wwwroot/nginx/html/backset.cn/
|
2023-03-06 13:33:38 +08:00
|
|
|
source: ./apps/web/dist/*
|
2023-03-19 01:43:03 +08:00
|
|
|
|
2023-03-20 09:49:00 +08:00
|
|
|
# admin管理
|
2023-03-19 01:43:03 +08:00
|
|
|
- name: build-admin
|
|
|
|
image: node:16.19-alpine
|
|
|
|
volumes:
|
|
|
|
- name: node_modules
|
|
|
|
path: /drone/src/node_modules
|
|
|
|
commands:
|
|
|
|
- pwd
|
|
|
|
- node -v
|
|
|
|
- npm -v
|
|
|
|
- npm install -g pnpm
|
2023-03-20 09:52:19 +08:00
|
|
|
- pnpm i
|
2023-03-19 01:43:03 +08:00
|
|
|
- pnpm build:admin
|
|
|
|
|
|
|
|
- name: deploy-admin
|
|
|
|
image: appleboy/drone-scp:1.6
|
|
|
|
settings:
|
|
|
|
host:
|
|
|
|
- backset.cn
|
|
|
|
username: root
|
|
|
|
password: cr654654.
|
|
|
|
port: 22
|
|
|
|
overwrite: true
|
|
|
|
command_timeout: 2m
|
|
|
|
target: /www/wwwroot/nginx/html/backset.cn/
|
|
|
|
source: ./apps/admin/dist/*
|
2023-03-20 09:49:00 +08:00
|
|
|
|
2023-03-20 10:21:21 +08:00
|
|
|
# server
|
|
|
|
- name: build-server
|
|
|
|
image: node:16.19-alpine
|
|
|
|
volumes:
|
|
|
|
- name: node_modules
|
|
|
|
path: /drone/src/node_modules
|
|
|
|
commands:
|
|
|
|
- pwd
|
|
|
|
- node -v
|
|
|
|
- npm -v
|
|
|
|
- npm install -g pnpm
|
|
|
|
- pnpm i
|
|
|
|
- pnpm build:server
|
2023-03-20 09:49:00 +08:00
|
|
|
|
2023-03-20 10:21:21 +08:00
|
|
|
- name: deploy-server
|
|
|
|
image: appleboy/drone-scp:1.6
|
2023-03-20 09:49:00 +08:00
|
|
|
settings:
|
|
|
|
host:
|
|
|
|
- backset.cn
|
|
|
|
username: root
|
2023-03-20 10:12:37 +08:00
|
|
|
password: cr654654.
|
2023-03-20 09:49:00 +08:00
|
|
|
port: 22
|
2023-03-20 10:21:21 +08:00
|
|
|
overwrite: true
|
2023-03-20 09:49:00 +08:00
|
|
|
command_timeout: 2m
|
2023-03-20 10:21:21 +08:00
|
|
|
target: /www/wwwroot/nginx/html/backset.cn/
|
|
|
|
source: ./apps/server/dist/*
|
|
|
|
|
|
|
|
# - name: docker build-server
|
|
|
|
# image: appleboy/drone-ssh
|
|
|
|
# settings:
|
|
|
|
# host:
|
|
|
|
# - backset.cn
|
|
|
|
# username: root
|
|
|
|
# password: cr654654.
|
|
|
|
# port: 22
|
|
|
|
# command_timeout: 2m
|
|
|
|
# script:
|
|
|
|
# - cd /www/wwwroot/n
|