我可以只使用build_disabled环境变量在主分支上运行构建作业

发布于 2025-02-02 11:02:11 字数 167 浏览 3 评论 0原文

我正在使用GitLab的AutodeVops运行CI,并且我想在主人分支以外的其他分支机构上禁用构建作业,因为我不需要在其他分支机构上运行构建作业。

看来我可以通过在规则中指定分支来做到这一点:如果在gitlab-ci.yaml中,但是我只能使用CI/CD环境变量build_disabled做到这一点吗?

I am running ci using gitlab's autodevops, and I would like to disable build job on working branches other than master because I don't need to run build jobs on other branches.

It looks like I can do this by specifying the branch in rules:if in gitlab-ci.yaml, but can I do that using only the ci/cd environment variable BUILD_DISABLED?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长亭外,古道边 2025-02-09 11:02:11

我似乎不可能只使用环境变量build_disabled在主分支上运行该作业。

仅使用声明或规则语句,它可以实现。

I seemed impossible to run the job on only the master branch using the environment variable BUILD_DISABLED.

Use only statement or rules statement and It can realize.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文