Merge pull request #249 from DarkKirb/also-upload-queue
upload to s3 cache with the upload queue as well
This commit is contained in:
commit
b7e44a548b
1 changed files with 28 additions and 0 deletions
|
@ -173,4 +173,32 @@ in {
|
|||
OnUnitActiveSec = 604800;
|
||||
};
|
||||
};
|
||||
systemd.services."upload-hydra-results" = {
|
||||
description = "Upload hydra build results";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "hydra-queue-runner";
|
||||
Group = "hydra";
|
||||
};
|
||||
script = ''
|
||||
set -ex
|
||||
if [ -e /var/lib/hydra/queue-runner/uploading ]; then
|
||||
cat /var/lib/hydra/queue-runner/uploading | xargs ${pkgs.nix}/bin/nix copy --to s3://cache-chir-rs?scheme=https&endpoint=ams1.vultrobjects.com&secret-key=${config.sops.secrets."services/hydra/cache-key".path}&multipart-upload=true&compression=zstd&compression-level=15 -vvv
|
||||
rm /var/lib/hydra/queue-runner/uploading
|
||||
fi
|
||||
mv /var/lib/hydra/queue-runner/upload-queue /var/lib/hydra/queue-runner/uploading
|
||||
cat /var/lib/hydra/queue-runner/uploading | xargs ${pkgs.nix}/bin/nix copy --to s3://cache-chir-rs?scheme=https&endpoint=ams1.vultrobjects.com&secret-key=${config.sops.secrets."services/hydra/cache-key".path}&multipart-upload=true&compression=zstd&compression-level=15 -vvv
|
||||
rm /var/lib/hydra/queue-runner/uploading
|
||||
'';
|
||||
};
|
||||
systemd.timers.upload-hydra-results = {
|
||||
enable = true;
|
||||
description = "Upload hydra build results";
|
||||
requires = ["upload-hydra-results.service"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
timerConfig = {
|
||||
OnBootSec = 300;
|
||||
OnUnitActiveSec = 300;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue