forked from malobeo/infrastructure
Add hydra spec files
This commit is contained in:
53
.hydra/declarative-jobsets.nix
Normal file
53
.hydra/declarative-jobsets.nix
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{ nixpkgs, pulls, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs { };
|
||||||
|
|
||||||
|
prs = builtins.fromJSON (builtins.readFile pulls);
|
||||||
|
prJobsets = pkgs.lib.mapAttrs (num: info: {
|
||||||
|
enabled = 1;
|
||||||
|
hidden = false;
|
||||||
|
description = "PR ${num}: ${info.title}";
|
||||||
|
checkinterval = 300;
|
||||||
|
schedulingshares = 20;
|
||||||
|
enableemail = false;
|
||||||
|
emailoverride = "";
|
||||||
|
keepnr = 1;
|
||||||
|
type = 1;
|
||||||
|
flake = "${info.head.repo.html_url}/archive/${info.head.ref}.tar.gz";
|
||||||
|
}) prs;
|
||||||
|
mkFlakeJobset = branch: {
|
||||||
|
description = "Build ${branch} branch of the Malobeo Infrastructure repo";
|
||||||
|
checkinterval = 300;
|
||||||
|
enabled = "1";
|
||||||
|
schedulingshares = 100;
|
||||||
|
enableemail = false;
|
||||||
|
emailoverride = "";
|
||||||
|
keepnr = 3;
|
||||||
|
hidden = false;
|
||||||
|
type = 1;
|
||||||
|
flake = "git+https://git.dynamicdiscord.de/malobeo/infrastructure/archive/${branch}.tar.gz";
|
||||||
|
};
|
||||||
|
|
||||||
|
desc = prJobsets // {
|
||||||
|
"master" = mkFlakeJobset "master";
|
||||||
|
};
|
||||||
|
|
||||||
|
log = {
|
||||||
|
pulls = prs;
|
||||||
|
jobsets = desc;
|
||||||
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
jobsets = pkgs.runCommand "spec-jobsets.json" { } ''
|
||||||
|
cat >$out <<'EOF'
|
||||||
|
${builtins.toJSON desc}
|
||||||
|
EOF
|
||||||
|
# This is to get nice .jobsets build logs on Hydra
|
||||||
|
cat >tmp <<'EOF'
|
||||||
|
${builtins.toJSON log}
|
||||||
|
EOF
|
||||||
|
${pkgs.jq}/bin/jq . tmp
|
||||||
|
'';
|
||||||
|
}
|
||||||
30
.hydra/spec.json
Normal file
30
.hydra/spec.json
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
{
|
||||||
|
"enabled": 1,
|
||||||
|
"hidden": false,
|
||||||
|
"description": "Malobeo infrastructure repo",
|
||||||
|
"nixexprinput": "nixexpr",
|
||||||
|
"nixexprpath": ".hydra/declarative-jobsets.nix",
|
||||||
|
"checkinterval": 60,
|
||||||
|
"schedulingshares": 100,
|
||||||
|
"enableemail": false,
|
||||||
|
"emailoverride": "",
|
||||||
|
"keepnr": 5,
|
||||||
|
"type": 0,
|
||||||
|
"inputs": {
|
||||||
|
"nixexpr": {
|
||||||
|
"value": "https://git.dynamicdiscord.de/ahtlon/infrastructure master",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"value": "https://github.com/NixOS/nixpkgs nixos-25.11",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"pulls": {
|
||||||
|
"type": "path",
|
||||||
|
"value": "http://127.0.0.1:27364/gitea-pulls-sorted.json",
|
||||||
|
"emailresponsible": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user