Add an explicit cache restore
This commit is contained in:
@@ -40,13 +40,7 @@ stages:
|
|||||||
${EXCEPT}
|
${EXCEPT}
|
||||||
sources
|
sources
|
||||||
before_script:
|
before_script:
|
||||||
- packer init sources
|
- nix run ".#cache-restore"
|
||||||
- echo $COMMAND
|
|
||||||
- mc alias set storage "http://localhost:9000" root "$MINIO_SECRET"
|
|
||||||
- mc ls storage/isos/cache
|
|
||||||
- file=$(echo var.iso.url | packer console -var-file="${distro}" -config-type=hcl2 sources/)
|
|
||||||
- mkdir cache
|
|
||||||
- mc get "storage/isos/$file" "$file"
|
|
||||||
script:
|
script:
|
||||||
- ls -l cache/
|
- ls -l cache/
|
||||||
- echo $COMMAND > build.sh
|
- echo $COMMAND > build.sh
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ downloads:
|
|||||||
paths:
|
paths:
|
||||||
- ./packer_config/
|
- ./packer_config/
|
||||||
script:
|
script:
|
||||||
|
- nix run ".#cache-restore"
|
||||||
- nix run ".#cache"
|
- nix run ".#cache"
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
mc alias set storage "$STORAGE_URL" root "$MINIO_SECRET"
|
||||||
|
|
||||||
|
for f in $(mc ls --json storage/isos/cache | jq '.key' | tr -d '"'); do
|
||||||
|
mc get -q "storage/isos/cache/$f" "./cache/$f"
|
||||||
|
done
|
||||||
@@ -53,6 +53,15 @@
|
|||||||
];
|
];
|
||||||
text = builtins.readFile ./cache.sh;
|
text = builtins.readFile ./cache.sh;
|
||||||
};
|
};
|
||||||
|
cache-restore = pkgs.writeShellApplication {
|
||||||
|
name = "cache-restore";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
jq
|
||||||
|
minio-client
|
||||||
|
packer
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./cache-restore.sh;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://numtide.github.io/treefmt/
|
# https://numtide.github.io/treefmt/
|
||||||
|
|||||||
Reference in New Issue
Block a user