From a3e79347be1cb4bf4171e0e2d43a6248ce1d920a Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Tue, 10 Mar 2020 12:15:53 +0100 Subject: [PATCH] my poor attempt at perl --- mirror-nixos-branch.pl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index e480aa6..4601947 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -227,3 +227,21 @@ system("git push channels $rev:refs/heads/$channelName >&2") == 0 or die; # Update channel on channels.nixos.org $bucketChannels->add_key($channelsDir, $target, { "x-amz-website-redirect-location" => $target }); $bucketChannels->add_key("$channelsDir/nixexprs.tar.xz", $target, { "x-amz-website-redirect-location" => "$target/nixexprs.tar.xz" }); + +# for nixos channels also create redirects for latest images +if ($channelName =~ /nixos/) { + for my $artifact ("nixos-graphical", + "nixos-plasma5", + "nixos-gnome", + "nixos-minimal", + "nixos-plasma5-x86_64-linux.ova" + "nixos-gnome-x86_64-linux.ova" + ) { + for my $arch ("x86_64", "i686") { + for my $format ("ova", "iso") { + $bucketChannels->add_key("$channelsDir/latest-$artifact-$arch-linux.$format", "", {"x-amz-website-redirect-location" => "$target/$artifact-$releaseThingy-$arch-linux.$format" }); + $bucketChannels->add_key("$channelsDir/latest-$artifact-$arch-linux.$format.sha256", "", {"x-amz-website-redirect-location" => "$target/$artifact-$releaseThingy-$arch-linux.$format.sha256" }); + } + } + } +}