From 11f8b7f5aa1a1d1d59b307842098db888d3d61ee Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 9 May 2020 12:52:31 +0100 Subject: [PATCH] gitlab-ci: use different caching strategy --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0caee890b2..2e56e0218e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,9 +4,10 @@ nixCache: - "mkdir -p ops/secrets" - "cp ${OPS_SECRETS_DEFAULT_NIX} ops/secrets/default.nix" - "test -d cache || mkdir cache" - - "nix-build ./ci-root.nix --option substituters \"file://$PWD/cache?trusted=1 https://cache.nixos.org s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" - - "nix copy --to 'file://cache' ./result" - - "nix copy --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" + - "test -f cache/nix.closure && nix-store --import < cache/nix.closure" + - "nix build -vv -f ./ci-root.nix --substituters \"https://cache.nixos.org s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" + - "nix-store --export $(nix-store -qR ./result) > cache/nix.closure" + - "nix copy -vv --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" cache: key: one-key-to-rule-them-all paths: