Tweak download script
This commit is contained in:
@@ -7,6 +7,7 @@ serial-output*
|
||||
grub.cfg
|
||||
isolinux.cfg
|
||||
Vagrantfile
|
||||
.direnv
|
||||
|
||||
# Generated distros
|
||||
distros/fedora/rawhide/*.hcl
|
||||
|
||||
+1
-7
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user