仅在提高MR后自动运行GitLab管道

时间:2020-10-29 06:56:05

标签: continuous-integration gitlab gitlab-ci gitlab-ci-runner

为了简短起见,这些是GitLab CI / CD管道工作流程的要求

  1. 管道应在MR创建事件上自动运行
  2. 在创建MR之前或之后,不对任何提交/推送运行管道

1 个答案:

答案 0 :(得分:-1)

要为所有作业的合并请求启用管道,可以使用workflow:rules

这里是一个例子:

workflow:
  rules:
    - if: $CI_MERGE_REQUEST_ID    # Execute jobs in merge request context

build:
  stage: build
  script: ./build

test:
  stage: test
  script: ./test

相关问题