summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-04 17:16:30 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-10-04 17:16:30 +0100
commit437f8afc7340150b5080985c8b3908fb485c151a (patch)
tree69abdcd9f16a35d7dee0e571def0fe49feb5b5ac
parent05f4fc2c5031264eff97d13c40b0bbc55849ee18 (diff)
downloaddefinitions-437f8afc7340150b5080985c8b3908fb485c151a.tar.gz
.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.
-rw-r--r--.gitlab-ci.yml14
1 files 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