Record top-level store paths of each release
We need this to do garbage collection on cache.nixos.org now that MANIFEST is gone.
This commit is contained in:
parent
f7beae78eb
commit
a058826231
1 changed files with 7 additions and 1 deletions
|
@ -8,6 +8,7 @@ use File::Path;
|
||||||
use File::Slurp;
|
use File::Slurp;
|
||||||
use JSON::PP;
|
use JSON::PP;
|
||||||
use LWP::UserAgent;
|
use LWP::UserAgent;
|
||||||
|
use List::MoreUtils qw(uniq);
|
||||||
|
|
||||||
my $branch = $ARGV[0];
|
my $branch = $ARGV[0];
|
||||||
my $jobset = $ARGV[1];
|
my $jobset = $ARGV[1];
|
||||||
|
@ -60,13 +61,18 @@ if (-d $releaseDir) {
|
||||||
print STDERR "release already exists\n";
|
print STDERR "release already exists\n";
|
||||||
} else {
|
} else {
|
||||||
my $tmpDir = dirname($releaseDir) . "/$releaseName-tmp";
|
my $tmpDir = dirname($releaseDir) . "/$releaseName-tmp";
|
||||||
print STDERR "$tmpDir\n";
|
|
||||||
File::Path::make_path($tmpDir);
|
File::Path::make_path($tmpDir);
|
||||||
|
|
||||||
write_file("$tmpDir/src-url", $evalUrl);
|
write_file("$tmpDir/src-url", $evalUrl);
|
||||||
write_file("$tmpDir/git-revision", $rev);
|
write_file("$tmpDir/git-revision", $rev);
|
||||||
write_file("$tmpDir/binary-cache-url", "https://cache.nixos.org");
|
write_file("$tmpDir/binary-cache-url", "https://cache.nixos.org");
|
||||||
|
|
||||||
|
if (! -e "$tmpDir/store-paths.xz") {
|
||||||
|
my $storePaths = decode_json(fetch("$evalUrl/store-paths", 'application/json'));
|
||||||
|
write_file("$tmpDir/store-paths", join("\n", uniq(@{$storePaths})) . "\n");
|
||||||
|
system("xz", "$tmpDir/store-paths") == 0 or die;
|
||||||
|
}
|
||||||
|
|
||||||
# Copy the manual.
|
# Copy the manual.
|
||||||
if (! -e "$tmpDir/manual") {
|
if (! -e "$tmpDir/manual") {
|
||||||
my $manualInfo = decode_json(fetch("$evalUrl/job/nixos.manual.x86_64-linux", 'application/json'));
|
my $manualInfo = decode_json(fetch("$evalUrl/job/nixos.manual.x86_64-linux", 'application/json'));
|
||||||
|
|
Loading…
Reference in a new issue