ci_template: Add an auto-retry policy
authorJordan Petridis <jordan@centricular.com>
Wed, 11 Sep 2019 14:39:14 +0000 (17:39 +0300)
committerJordan Petridis <jordan@centricular.com>
Tue, 24 Sep 2019 05:19:44 +0000 (08:19 +0300)
Its common that docker will throw transient errors, especially
on the windows runner. If such the case, automatically retry
the job.

gitlab/ci_template.yml

index af0ed80..19b0079 100644 (file)
@@ -35,8 +35,17 @@ variables:
     --variants werror
     --timestamps
 
+.global_retry_policy:
+  retry:
+    max: 2
+    when:
+      - 'runner_system_failure'
+      - 'api_failure'
+
 manifest:
   image: $MANIFEST_IMAGE
+  extends:
+    - '.global_retry_policy'
   stage: 'preparation'
   script:
     - cd /gst-ci
@@ -50,6 +59,8 @@ manifest:
 
 gst indent:
   image: $INDENT_IMAGE
+  extends:
+    - '.global_retry_policy'
   stage: 'preparation'
   variables:
     GIT_STRATEGY: 'fetch'
@@ -77,6 +88,8 @@ gst indent:
 
 .build:
   stage: 'build'
+  extends:
+    - '.global_retry_policy'
   needs:
     - "manifest"
   dependencies:
@@ -170,6 +183,8 @@ build clang fedora x86_64:
 
 .test:
   stage: 'test'
+  extends:
+    - '.global_retry_policy'
   variables:
     # Disable colored output to avoid weird rendering issues
     GST_DEBUG_NO_COLOR: "true"
@@ -312,6 +327,8 @@ valgrind ges:
 .cerbero:
   stage: "build"
   image: $CERBERO_IMAGE
+  extends:
+    - '.global_retry_policy'
   needs:
     - "manifest"
   dependencies:
@@ -375,6 +392,8 @@ valgrind ges:
 
 .build windows:
   image: $WINDOWS_IMAGE
+  extends:
+    - '.global_retry_policy'
   stage: 'build'
   needs:
     - 'manifest'
@@ -633,6 +652,8 @@ build cerbero cross win64:
 #
 .cross-android universal examples:
   image: $ANDROID_IMAGE
+  extends:
+    - '.global_retry_policy'
   stage: 'integrate'
   variables:
     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
@@ -811,6 +832,8 @@ build cerbero cross-ios universal:
 
 documentation:
   image: $FEDORA_IMAGE
+  extends:
+    - '.global_retry_policy'
   needs:
     - "build fedora x86_64"
     - "manifest"
@@ -841,6 +864,8 @@ documentation:
 #
 .cross-ios universal examples:
   stage: 'integrate'
+  extends:
+    - '.global_retry_policy'
   variables:
     EXAMPLES_HOME: ${CI_PROJECT_DIR}/examples
     # disable codesigning so we don't need developer identities on the CI