如何配置我的YAML文件,以便仅在推送标记时触发一个案例(作业:构建)的管道。此标记可能位于除master之外的所有分支中。对于主案例,我有一个单独的工作(build_master)。
yaml文件: 问题:如果主分支获得标记,则管道将通过" build"运行。这不应该发生。什么都不应该发生
before_script:
- xcopy /y /s "C:/stuff" "%CI_PROJECT_DIR%"
stages:
- build
- deploy
build:
stage: build
script:
- build.cmd
artifacts:
expire_in: 1 week
name: "%CI_COMMIT_REF_NAME%"
paths:
- "%CI_COMMIT_REF_NAME%"
only:
- tags
except:
- master
build_master:
stage: build
script:
- buildm.cmd
artifacts:
expire_in: 1 week
name: "%CI_COMMIT_REF_NAME%"
paths:
- "%CI_COMMIT_REF_NAME%"
only:
- master
deploy:
stage: deploy
script:
- ./upload.cmd
dependencies:
- build_master
only:
- master
答案 0 :(得分:2)