Tweak download script
This commit is contained in:
@@ -7,6 +7,7 @@ serial-output*
|
|||||||
grub.cfg
|
grub.cfg
|
||||||
isolinux.cfg
|
isolinux.cfg
|
||||||
Vagrantfile
|
Vagrantfile
|
||||||
|
.direnv
|
||||||
|
|
||||||
# Generated distros
|
# Generated distros
|
||||||
distros/fedora/rawhide/*.hcl
|
distros/fedora/rawhide/*.hcl
|
||||||
|
|||||||
+1
-7
@@ -70,13 +70,7 @@ downloads:
|
|||||||
paths:
|
paths:
|
||||||
- ./packer_config/
|
- ./packer_config/
|
||||||
script:
|
script:
|
||||||
- packer init sources
|
- nix run ".#cache"
|
||||||
- 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
|
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
stage: trigger
|
stage: trigger
|
||||||
|
|||||||
@@ -24,3 +24,9 @@ curl --parallel -L "${files[@]}"
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
ls -lh cache/
|
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 = {
|
devshells.default = {
|
||||||
# These commands will be shown in the motd that users read
|
# These commands will be shown in the motd that users read
|
||||||
# upon entering the shell
|
# 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
|
# This is not special, this is just flakes
|
||||||
packages = let
|
packages = {
|
||||||
src = ./.;
|
|
||||||
in {
|
|
||||||
cache = pkgs.writeShellApplication {
|
cache = pkgs.writeShellApplication {
|
||||||
name = "cache-isos";
|
name = "cache-isos";
|
||||||
runtimeInputs = with pkgs; [
|
runtimeInputs = with pkgs; [
|
||||||
|
curl
|
||||||
minio-client
|
minio-client
|
||||||
packer
|
packer
|
||||||
];
|
];
|
||||||
text = let
|
text = builtins.readFile ./cache.sh;
|
||||||
#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*
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user