gitlab-ci: Retry jobs after runner system failures

Up to twice, for a total of 3 attempts maximum.

This will hopefully avoid spurious CI pipeline failures due to
intermittent GitLab/docker infrastructure issues.

Inspired by
6140ed3d2c

Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Michel Dänzer 2019-03-29 10:12:40 +01:00 committed by Michel Dänzer
parent b5ef99f26a
commit fee147d75e
1 changed files with 9 additions and 0 deletions

View File

@ -30,11 +30,20 @@ stages:
- docker-image
- build-and-test
# Retry jobs after runner system failures
.retry: &retry
retry:
max: 2
when:
- runner_system_failure
debian-testing:
extends: .debian@container-ifnot-exists
stage: docker-image
<<: *retry
.common-build-and-test:
<<: *retry
stage: build-and-test
image: $IMAGE_LOCAL
artifacts: