I'm using a self-hosted GitLab CI server
(community edition v8.9.5) and gitlab-ci-multi-runner
1.2.0 to build a project. One of my pipeline stages (test) takes a while to run and I get the following erm:
ERROR: Build failed: execution took longer than 3600 seconds
Where do I put the override for this timeout? Can I apply it to just the test pipeline stage?
History of stages in GitLab CI/CD By default, stages are ordered as: build , test , and deploy - so all stages execute in a logical order that matches a development workflow. The first step is to build the code, and if that works, the next step is to test it. If the tests pass, then you deploy the application.
These are scripts that you choose to be run before the job is executed or after the job is executed. These can also be defined at the top level of the YAML file (where jobs are defined) and they'll apply to all jobs in the . gitlab-ci. yml file.
variables: GIT_STRATEGY: fetch. none also re-uses the project workspace, but skips all Git operations (including GitLab Runner's pre-clone script, if present). It is mostly useful for jobs that operate exclusively on artifacts (e.g., deploy ).
CI_COMMIT_TAG - The commit tag name. Present only when building tags. Therefore in the variables section CI_COMMIT_TAG is not defined, hence equals to "". So if you want to use CI_COMMIT_TAG use in job where tags are defined.
You can set a global timeout in "Project settings -> CI/CD Pipelines -> Timeout" or "Project settings -> Builds -> Timeout" in older versions.
As of version 12.3, you can set a timeout per stage in your CI .yml file using timeout
:
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.
There are two timeout can be set: project timeout and runner timeout.
Project timeout:
It is possible to set timeout per job from Settings -> CI/CD -> General pipelines
Runner timeout:
runner's timeout can be set from Settings -> CI/CD -> Runners, select the runner from Runners activated for this project and edit the Maximum job timeout from the runner edit form.
Be aware that these two types of timeout can be overridden by each other. Refer the docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With