2024-08-13 15:47:13 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: feiyang-web
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: build
|
|
|
|
image: node:18.18.0
|
|
|
|
volumes:
|
|
|
|
- name: build-file
|
|
|
|
path: /build/dist
|
|
|
|
commands:
|
|
|
|
- npm install --registry=https://registry.npmmirror.com/
|
|
|
|
- npm run build
|
|
|
|
- cp -r dist/. /build/dist
|
|
|
|
|
|
|
|
- name: remote_transmit
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
image: appleboy/drone-ssh # SSH工具镜像
|
|
|
|
settings:
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
host: 101.43.112.107 # 远程连接地址
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
username: root # 远程连接账号
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
password:
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
from_secret: ssh_password # 从Secret中读取SSH密码
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
port: 22 # 远程连接端口
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
command_timeout: 5m # 远程执行命令超时时间
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
script:
|
|
|
|
- scp -r /feiyang/build/font root@1.94.20.201:/root/testserver
|
2024-08-13 15:52:54 +08:00
|
|
|
|
2024-08-13 15:47:13 +08:00
|
|
|
volumes: # 定义流水线挂载目录,用于共享数据
|
|
|
|
- name: build-file
|
|
|
|
host:
|
|
|
|
path: /feiyang/build/font # 从宿主机中挂载的目录
|