2.8.2.2. 使用 CLI 设置提交后构建 hook

oc set build-hook 命令可用于为构建配置设置构建 hook。

流程

  1. 将命令设置为提交后构建 hook:

    $ oc set build-hook bc/mybc \
        --post-commit \
        --command \
        -- bundle exec rake test --verbose
  2. 将脚本设置为提交后构建 hook:

    $ oc set build-hook bc/mybc --post-commit --script="bundle exec rake test --verbose"