Files
Git_Backup/.drone-s3.yml
offends cee540e42b
All checks were successful
continuous-integration/drone Build is passing
first commit
2025-12-26 20:42:27 +08:00

41 lines
968 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
TAR_NAME:
from_secret: TAR_NAME
commands:
- bash Build.sh "$GIT_USERNAME" "$GIT_PASSWORD" "$TAR_NAME"
- name: Backup File To S3
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:mc
pull: if-not-exists
environment:
S3_URl:
from_secret: S3_URl
S3_ACCESS_KEY:
from_secret: S3_ACCESS_KEY
S3_SECRET_KEY:
from_secret: S3_SECRET_KEY
TAR_NAME:
from_secret: TAR_NAME
S3_BUCKET:
from_secret: S3_BUCKET
commands:
- mc alias set S3 $S3_URl $S3_ACCESS_KEY $S3_SECRET_KEY
- mc cp ./$TAR_NAME.tar.gz S3/$S3_BUCKET/