Files
Git_Backup/.drone-minio.yml
2025-08-25 16:04:54 +08:00

35 lines
854 B
YAML

kind: pipeline
type: docker
name: Git Backup
# 手动触发或接口触发
trigger:
event:
- custom
steps:
# 账号密码特殊字符需要使用 URL 编码代替
- name: Git Clone
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:git
pull: if-not-exists
environment:
GIT_USERNAME:
from_secret: GIT_USERNAME
GIT_PASSWORD:
from_secret: GIT_PASSWORD
commands:
- bash Build.sh $GIT_USERNAME $GIT_PASSWORD
- name: Backup File To Minio
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:mc
pull: if-not-exists
environment:
MINIO_URl:
from_secret: MINIO_URl
MINIO_ACCESS_KEY:
from_secret: MINIO_ACCESS_KEY
MINIO_SECRET_KEY:
from_secret: MINIO_SECRET_KEY
commands:
- mc config host add minio $MINIO_URl $MINIO_ACCESS_KEY $MINIO_SECRET_KEY
- mc cp ./*.tar.gz minio/backup/