From b9e5dac14c5b441a404d4821ae63eeb4b5dacccd Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sat, 9 May 2020 13:48:37 +0100 Subject: [PATCH] gitlab-ci: tweak caching strategy /nix/store is now just a Docker volume on the host running the build, so the store should just implicitly get shared. --- .gitlab-ci.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2e56e0218e..253b039eb8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,13 +1,14 @@ +stages: + - build + nixCache: + stage: build image: "nixos/nix:latest" script: - "mkdir -p ops/secrets" - "cp ${OPS_SECRETS_DEFAULT_NIX} ops/secrets/default.nix" - - "test -d cache || mkdir cache" - - "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" + - "nix build -v -f ./ci-root.nix --substituters \"https://cache.nixos.org s3://lukegb-nix-cache?endpoint=storage.googleapis.com&trusted=1\"" + - "nix copy -v --to 's3://lukegb-nix-cache?endpoint=storage.googleapis.com' ./result" cache: key: one-key-to-rule-them-all paths: