Tweak download script

This commit is contained in:
Greg Hellings
2024-06-21 13:00:22 -05:00
parent 91c56299ec
commit fc1d419506
4 changed files with 16 additions and 22 deletions
+1
View File
@@ -7,6 +7,7 @@ serial-output*
grub.cfg
isolinux.cfg
Vagrantfile
.direnv
# Generated distros
distros/fedora/rawhide/*.hcl
+1 -7
View File
@@ -70,13 +70,7 @@ downloads:
paths:
- ./packer_config/
script:
- packer init sources
- bash cache.sh
- mc alias set storage "http://localhost:9000" root "$MINIO_SECRET"
- |
for f in cache/*; do
mc put "$f" "storage/isos/$f"
end
- nix run ".#cache"
trigger:
stage: trigger
+6
View File
@@ -24,3 +24,9 @@ curl --parallel -L "${files[@]}"
popd
ls -lh cache/
mc alias set storage "$STORAGE_URL" root "$MINIO_SECRET"
for f in cache/*; do
mc put "$f" "storage/isos/$f"
done
+8 -15
View File
@@ -35,30 +35,23 @@
devshells.default = {
# These commands will be shown in the motd that users read
# upon entering the shell
commands = [
];
commands = [ {
package = self'.packages.cache;
category = "utils";
help = "Downloads ISO files and adds them to the S3 bucket";
} ];
};
# This is not special, this is just flakes
packages = let
src = ./.;
in {
packages = {
cache = pkgs.writeShellApplication {
name = "cache-isos";
runtimeInputs = with pkgs; [
curl
minio-client
packer
];
text = let
#getIso = t: pkgs.runCommand "t.txt" {
#nativeInputs = [ pkgs.packer ];
#} "echo var.iso.url | ${pkgs.packer}/bin/packer console -var-file=\"${t}\" -config-type=hcl2 ${src}/sources/";
#isos = lib.attrsets.mapAttrsToList (t: builtins.readFile (getIso t)) templates;
#processIsos = builtins.concatStringsSep "\n" (builtins.map (i: "echo ${i}") isos);
in ''
packer init sources/
rm -f cache/*latest* cache/*Rawhide*
'';
text = builtins.readFile ./cache.sh;
};
};