避免对合并请求重复运行-除了merge_requests不起作用

时间:2019-05-15 11:38:17

标签: gitlab

我正在尝试使gitlab在merge_requests上运行1个阶段(而不是在分支的推送上-因此,对于merge_request我只得到1个) 并在所有分支上设置gitlab(实际上是相同的-但我可以在必要时两次定义它),可以在所有分支上使用(但不必在merge_requests上使用)。

我已经尝试过了:

# Builds for all - except snapshots (branches) - as we would otherwise have 2x build run on merge_requests
build:
  stage: build
  only:
    refs:
      - merge_requests
      - tags
  artifacts:
    paths:
      - build/
  script:
    - ./build/build.sh ${CI_JOB_ID}

#EXACT copy of above - ONLY for snapshot builds
build-snapshot:
  stage: build
  only:
    - branches
  except:
    - merge_requests
    - test
  artifacts:
    paths:
      - build/
  script:
    - ./build/build.sh ${CI_JOB_ID}

,除了:refs:..(即,高级)-都产生相同的结果..看来gitlab看不到该分支有merge_request-因此它为分支运行它,并且对于merge_request:(

我发现以下问题无济于事: https://gitlab.com/gitlab-org/gitlab-ce/issues/13445

0 个答案:

没有答案