Skip to main content
 首页 » 编程设计

timeout之GitLab CI 管道阶段超时

2024年12月31日18落叶无声

我正在使用自托管 GitLab CI server (社区版 v8.9.5)和 gitlab-ci-multi-runner 1.2.0 构建项目。我的一个管道阶段(测试)需要一段时间才能运行,我得到以下 erm:

ERROR: Build failed: execution took longer than 3600 seconds 


我在哪里放置此超时的覆盖?我可以将它仅应用于测试管道阶段吗?

请您参考如下方法:

在旧版本中,您可以在“项目设置 -> CI/CD 管道 -> 超时”或“项目设置 -> 构建 -> 超时”中设置全局超时。
从 12.3 版开始,您可以使用 timeout 在 CI .yml 文件中设置每个阶段的超时时间:

timeout allows you to configure a timeout for a specific job. For example:

build: 
  script: build.sh 
  timeout: 3 hours 30 minutes 
 
test: 
  script: rspec 
  timeout: 3h 30m 

The job-level timeout can exceed the project-level timeout but can’t exceed the Runner-specific timeout.