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



commit 4fe61aa05f98449bc383a02fd47d8ff488ba4cbd
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 0130bac..389371a 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]