[gnome-build-meta/alatiera/push-master: 6/7] .gitlab-ci.yml: extract the cache configuration in a template



commit 470c0ca1f40c27d6f373c1d664a3b7d9e0b13e53
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Thu Sep 27 20:18:49 2018 +0100

    .gitlab-ci.yml: extract the cache configuration in a template

 .gitlab-ci.yml | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9b76b68..dabe107 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -85,6 +85,15 @@ before_script:
 
     fi
 
+.cache-template: &cache
+  # Store all the downloaded sources in the distributed cache. This saves
+  # us fetching them from the different repos and further afield
+  # on every build.
+  cache:
+    key: bst
+    paths:
+      - "${XDG_CACHE_HOME}/buildstream/sources/"
+
 .build-template: &build
   stage: build
   script:
@@ -114,13 +123,7 @@ before_script:
         ssh gbm-builder.gnome.org gbm-flatpak-scripts/import-commits -c "${CONFIG_FILE}" 
incoming/repo-${CI_JOB_ID} ${BRANCHES}
       fi
 
-  # Store all the downloaded git and ostree repos in the distributed cache.
-  # This saves us fetching them from the different repos and further afield
-  # on every build.
-  cache:
-    key: bst
-    paths:
-      - "${XDG_CACHE_HOME}/buildstream/sources/"
+  <<: *cache
   # Store artifacts so we can inspect build failures
   artifacts:
     when: always
@@ -135,12 +138,7 @@ track:
   script:
     - ${BST} track --deps all core.bst flatpak-runtimes.bst
 
-  # Store all the downloaded sources in the distributed cache, so that later
-  # jobs don't need to redownload them.
-  cache:
-    key: bst
-    paths:
-      - "${XDG_CACHE_HOME}/buildstream/sources/"
+  <<: *cache
   # don't run on stable branches
   except:
     - /^gnome-\d-\d\d$/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]