From 437f8afc7340150b5080985c8b3908fb485c151a Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 4 Oct 2017 17:16:30 +0100 Subject: .gitlab-ci.yml: Really enable caching of downloaded sources It turns out that downloaded sources have never been shared between builds. Each container running a build has a `/cache` volume, but a new volume is created for each container so nothing is shared. We listed certain paths inside `/cache` to be saved by GitLab CI between runs using the "distributed runners cache" feature, but because the paths were outside the build directory it would just ignore them. --- .gitlab-ci.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b4576663..1b08d733 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,16 +1,23 @@ image: buildstream/buildstream-fedora:latest variables: + # Store cache in the shared Docker volume, which gives us much more space + # than if we store it in the root disk + XDG_CACHE_HOME: "/cache" YBD_base: "/cache/ybd_base" YBD_gits: "/cache/ybd_base/gits" + GET_SOURCES_ATTEMPTS: 3 cache: paths: - - "${YBD_gits}/" - - "/cache/buildstream/sources/" + - ."${YBD_gits}/" + - "./cache/buildstream/sources/" before_script: + # GitLab CI won't cache stuff outside the build directory, so we trick it! + - ln -s /cache ./cache + # Update to latest BuildStream - | cd ~/buildstream @@ -19,9 +26,6 @@ before_script: pip3 install . cd - - # Store cache in the shared Docker volume - - export XDG_CACHE_HOME=/cache - # Create ~/.ssh for storing keys - mkdir -p ~/.ssh -- cgit v1.2.1