buildkite

Buildkite CI 流水线

补充说明

Buildkite 由托管控制面和自建 agent 组成,流水线用 YAML 定义,构建在自有基础设施上执行。适合需要自定义构建环境、GPU 或内网访问的团队。

核心概念:pipeline、step、agent、queue、plugin、hook。

常用示例

安装 agent:

curl -fsSL https://buildkite.com/install | bash
buildkite-agent start --token "$BUILDKITE_AGENT_TOKEN"

pipeline.yml:

steps:
- label: ":test_tube: test"
  command: "make test"
  agents:
    queue: "linux"
- label: ":docker: build"
  command: "docker build -t app:$BUILDKITE_COMMIT ."
  depends_on: test
- wait
- label: ":rocket: deploy"
  command: "./deploy.sh"
  if: build.branch == "main"

动态流水线:

buildkite-agent pipeline upload .buildkite/deploy.yml

易错点与排错