2023-03-05 17:17:04 +08:00
|
|
|
---
|
|
|
|
kind: pipeline
|
2023-03-06 10:06:47 +08:00
|
|
|
type: docker
|
2023-03-20 11:29:37 +08:00
|
|
|
name: admin & web 资源发布
|
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:29:53 +08:00
|
|
|
---
|
|
|
|
kind: pipeline
|
|
|
|
type: exec
|
2023-03-20 11:29:37 +08:00
|
|
|
name: server 镜像生产&容器发布
|
2023-03-20 10:29:53 +08:00
|
|
|
|
|
|
|
steps:
|
2023-03-20 11:00:59 +08:00
|
|
|
- name: deprecate container
|
|
|
|
commands:
|
|
|
|
- docker stop backset-server
|
|
|
|
- docker rm backset-server
|
2023-03-20 11:29:37 +08:00
|
|
|
|
2023-03-20 10:43:40 +08:00
|
|
|
- name: docker image
|
2023-03-20 10:29:53 +08:00
|
|
|
commands:
|
2023-03-20 13:05:51 +08:00
|
|
|
- docker-compose build -p node-backset-api
|
2023-03-20 10:43:40 +08:00
|
|
|
|
|
|
|
- name: docker container
|
|
|
|
commands:
|
2023-03-20 11:00:59 +08:00
|
|
|
- docker-compose up -d
|