Buildkite Agent 与流水线操作
buildkite-agent 在自有机器上执行 Buildkite 下发的 job,负责检出代码、运行命令、上传制品和回传日志。流水线步骤可以用 pipeline upload 动态生成。
buildkite-agent --version
buildkite-agent start
buildkite-agent pipeline upload
buildkite-agent pipeline upload .buildkite/deploy.yml
buildkite-agent annotate "Deploy finished" --style success
buildkite-agent artifact upload "dist/**/*"
buildkite-agent artifact download dist/app.tar.gz .
buildkite-agent meta-data set version 1.2.3
buildkite-agent meta-data get version
buildkite-agent bootstrap
动态步骤:
buildkite-agent pipeline upload <<'YAML'
steps:
- label: ":test_tube: Test"
command: npm test
- wait
- label: ":rocket: Deploy"
command: ./deploy.sh
agents:
queue: deploy
YAML
pipeline upload 生成的步骤是动态的;上传失败时后续步骤根本不存在。github-actions — GitHub 流水线gitlab-ci — GitLab 流水线docker — 容器化 agent