Skip to content

插件体系概览

CNB 插件本质是 Docker 镜像。流水线通过镜像运行插件,并通过 settings 传入参数。

yaml
main:
  push:
    - stages:
        - name: hello
          image: cnbcool/hello-world
          settings:
            text: hello world

参数会转换为 PLUGIN_ 前缀环境变量:

text
settings.text -> PLUGIN_TEXT

适合做成插件的能力:

  • 标准化构建、测试、部署动作。
  • 多仓库复用的通知、制品、发布流程。
  • 需要固定运行环境的自动化任务。