Tob*_*ann 5 continuous-integration gitlab
在内部 GitLab 服务器上,有一个项目的 CI 脚本不支持多个管道的并发执行(Kubernetes 中的外部副作用)。因此,如果连续推送两次提交,且两次提交之间的时间少于第一个管道需要完成的时间,则这两个管道将同时运行,这会导致两者都失败。
在这种情况下,对 CI 运行器进行全局设置concurrent = 1(跨多个存储库使用一个 K8s 运行器)是不切实际的,因为应允许使用该运行器的其他项目的管道同时运行。
是否可以仅禁止一个项目使用 CI 并发?取消旧的管道或对新的管道进行排队都可以。
您可以limit =1按照以下链接中的讨论使用
https://gitlab.com/gitlab-org/gitlab-ce/issues/18224
concurrent = 3 // Attribute that limits a number of projects
check_interval = 0
[[runners]]
limit = 1 // Attribute that limits quantity job by runners
name = "test-ci"
url = "https://gitlab.com/ci"
token = "38274bf1655a0f48d72b15815a83d4e6a85689"
executor = "shell"
[runners.cache]
[[runners]]
limit = 1
name = "teste2"
url = "https://gitlab.com/ci"
token = "38274bf1655a0f48d72b15815a83d4e6a85689"
executor = "shell"
[runners.cache]
Run Code Online (Sandbox Code Playgroud)
不要使用共享运行程序,而是在您的案例中使用特定于项目的运行程序,这样其他项目就不会受到影响
| 归档时间: |
|
| 查看次数: |
4472 次 |
| 最近记录: |