first commit
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2025-12-26 20:42:27 +08:00
commit cee540e42b
6 changed files with 211 additions and 0 deletions

40
.drone-oss.yml Normal file
View File

@@ -0,0 +1,40 @@
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 OSS
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:oss
pull: if-not-exists
environment:
OOS_ENDPOINT:
from_secret: OOS_ENDPOINT
OOS_ACCESSKEYID:
from_secret: OOS_ACCESSKEYID
OOS_ACCESSKEYSECRET:
from_secret: OOS_ACCESSKEYSECRET
OOS_PATH:
from_secret: OOS_PATH
TAR_NAME:
from_secret: TAR_NAME
commands:
- ossutil64 -e $OOS_ENDPOINT -i $OOS_ACCESSKEYID -k $OOS_ACCESSKEYSECRET cp ./$TAR_NAME.tar.gz $OOS_PATH --force