if CI_COMMIT_TAG 规则和 only:tags 之间有什么区别?
What is the difference between an if CI_COMMIT_TAG rule and only:tags?
Gitlab CI 文档推荐这样的规则
rules:
- if: $CI_COMMIT_TAG
到 运行 个职位仅在标签上。参见示例 https://docs.gitlab.com/ee/user/project/releases/index.html#use-a-generic-package-for-attaching-binaries。和
有什么区别
only:
- tags
在我看来,这些应该是等效的,我的测试也指向那个方向。但是,我不确定并且无法在文档中找到任何解释为什么 only:tags
方法未在这个特定示例中使用。
在功能上它们是相同的,但首选关键字现在是 rules
。
only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.
Gitlab CI 文档推荐这样的规则
rules:
- if: $CI_COMMIT_TAG
到 运行 个职位仅在标签上。参见示例 https://docs.gitlab.com/ee/user/project/releases/index.html#use-a-generic-package-for-attaching-binaries。和
有什么区别only:
- tags
在我看来,这些应该是等效的,我的测试也指向那个方向。但是,我不确定并且无法在文档中找到任何解释为什么 only:tags
方法未在这个特定示例中使用。
在功能上它们是相同的,但首选关键字现在是 rules
。
only and except are not being actively developed. rules is the preferred keyword to control when to add jobs to pipelines.