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



commit 32e1a9d49bccfb12aa63f5b18426e0171ec10a9c
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 e051caf..e00492c 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:
@@ -108,13 +117,7 @@ before_script:
         ssh gbm-builder.gnome.org gbm-flatpak-scripts/import-commits -c config/stable.json 
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
@@ -129,12 +132,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
   artifacts:
     when: always
     paths:


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