我正在尝试使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