Files
test/.drone.yml
moweishan 07d858ea16
Some checks failed
continuous-integration/drone/push Build encountered an error
更新 .drone.yml
2025-12-29 15:49:09 +00:00

44 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
kind: pipeline
type: docker
name: main-automated-pipeline
# ✅ 核心修复拆分触发规则符合Drone官方语法规范
trigger:
event:
- push
- promote
- manual
steps:
# ====== 自动执行步骤仅push到main分支触发======
- name: print-auto-run
image: alpine:latest
commands:
- echo "====================================="
- echo "这是自动运行的流水线"
- echo "触发事件: ${DRONE_BUILD_EVENT}"
- echo "触发分支: ${DRONE_BRANCH}"
- echo "提交者: ${DRONE_COMMIT_AUTHOR}"
- echo "提交消息: ${DRONE_COMMIT_MESSAGE}"
- echo "自动运行"
- echo "====================================="
when:
event: push
branch: main
# ====== 手动执行步骤仅promote/manual+生产环境触发)======
- name: print-manual-trigger
image: alpine:latest
commands:
- echo "====================================="
- echo "这是手动触发的流水线"
- echo "触发事件: ${DRONE_BUILD_EVENT}"
- echo "触发目标: ${DRONE_DEPLOY_TO}"
- echo "当前时间: $(date)"
- echo "手动触发"
- echo "====================================="
when:
event:
- promote
- manual
target: production