kind: pipeline type: docker name: main-automated-pipeline trigger: event: - push - promote - manual steps: - name: print-auto-run image: alpine:latest when: event: push branch: main commands: - echo ===================================== - echo 这是自动运行的流水线 - echo 触发事件: ${DRONE_BUILD_EVENT} - echo 触发分支: ${DRONE_BRANCH} - echo 提交者: ${DRONE_COMMIT_AUTHOR} - echo 提交消息: ${DRONE_COMMIT_MESSAGE} - echo 自动运行 - echo ===================================== - name: print-manual-trigger image: alpine:latest when: event: - promote - manual target: production commands: - echo ===================================== - echo 这是手动触发的流水线 - echo 触发事件: ${DRONE_BUILD_EVENT} - echo 触发目标: ${DRONE_DEPLOY_TO} - echo 当前时间: $(date) - echo 手动触发 - echo =====================================