diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-10-04 17:51:44 +0100 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-10-04 17:51:44 +0100 |
commit | 1e7b235b14b232c04ed28fdd3d60b51866484332 (patch) | |
tree | f7a16164c72ad66d08d6c7d55566309c98264e99 /.gitlab-ci.yml | |
parent | 437f8afc7340150b5080985c8b3908fb485c151a (diff) | |
download | definitions-1e7b235b14b232c04ed28fdd3d60b51866484332.tar.gz |
.gitlab-ci.yml: Fix caching, part three
With the previous attempt, storing files in the cache worked OK but
restoring from the cache did not. The symlink workaround wasn't enough
as the symlink gets created /after/ the cache is restored.
Now the whole /builds tree is on a separate Docker volume, so we should
be able to really store the cache inside the build directory.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1b08d733..758ed436 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,22 +1,24 @@ 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/" + # Store all the downloaded git and ostree repos in the distributed cache. + # This saves us fetching them from git.baserock.org and further afield + # on every build. + - cache/ybd_base/gits + - cache/buildstream/sources/ before_script: - # GitLab CI won't cache stuff outside the build directory, so we trick it! - - ln -s /cache ./cache + # Store everything under the /builds directory. This is a separate Docker + # volume. Note that GitLab CI will only cache stuff inside the build + # directory. + - | + export XDG_CACHE_HOME="$(pwd)/cache" + export YBD_base="$(pwd)/cache/ybd_base" + export YBD_gits="$(pwd)/cache/ybd_base/gits" # Update to latest BuildStream - | |