aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-10-18 14:19:19 +0200
committerAlex Auvolat <alex@adnab.me>2022-10-18 14:19:19 +0200
commita54a63c491556b746dab02a0766034af70c61457 (patch)
tree769c3b645ce600a3ea5d84214f0d38cff022421b
parent8fc93abc79eb3fa74facda7ca2e8798ff7d01658 (diff)
downloadgarage-a54a63c491556b746dab02a0766034af70c61457.tar.gz
garage-a54a63c491556b746dab02a0766034af70c61457.zip
Add function to upload a build and its dependencies to the cacheupgrade-toolchain
to faster bootstrap new runner nodes
-rw-r--r--shell.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix
index 3b98f8b1..480bc349 100644
--- a/shell.nix
+++ b/shell.nix
@@ -66,6 +66,18 @@ function refresh_toolchain {
rm /tmp/nix-signing-key.sec
}
+function refresh_cache {
+ pass show deuxfleurs/nix_priv_key > /tmp/nix-signing-key.sec
+ for attr in clippy.amd64 test.amd64 pkgs.{amd64,i386,arm,arm64}.{debug,release}; do
+ echo "Updating cache for ''${attr}"
+ derivation=$(nix-instantiate --attr ''${attr})
+ nix copy \
+ --to 's3://nix?endpoint=garage.deuxfleurs.fr&region=garage&secret-key=/tmp/nix-signing-key.sec' \
+ $(nix-store -qR ''${derivation%\!bin})
+ done
+ rm /tmp/nix-signing-key.sec
+}
+
function to_s3 {
aws \
--endpoint-url https://garage.deuxfleurs.fr \