问题:我的管道中有两个作业,我只想通过“运行管道”按钮来运行,我需要为任何分支运行这个作业。但是当我选择任何一个非主分支时,gitlab告诉我“管道不能运行。这个管道没有阶段/作业。”
首先,我使用“rules”关键字配置了作业,但配置了“only”关键字:
only:
refs:
- api
- web我要怎么做才能让我的手动管道可以运行?
我的愤恨:
stages:
- test
- publish
.run_branch_from_gui:
only:
- branches
- tags
except:
- master
when: manual
compile_and_test_branch_manually:
stage: publish
extends:
- .run_branch_from_gui
script: "echo 'test'"
publish_docker_image_branch_manually:
extends:
- .run_branch_from_gui
image: $DOCKER_IMAGE
dependencies:
- compile_and_test_branch_manually
stage: publish
script: "echo 'publish'"我也尝试过:
rules:
- if: '$CI_PIPELINE_SOURCE == "web"'
when: manual
allow_failure: false但是没有效果:当我单击“运行管道”按钮时,仍然有“管道不能运行。该管道没有阶段/作业。”按钮。
https://stackoverflow.com/questions/68637282
复制相似问题