init
This commit is contained in:
76
.hydra/declarative-jobset.nix
Normal file
76
.hydra/declarative-jobset.nix
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
{ 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";
|
||||||
|
inputs = {
|
||||||
|
gitea_repo_name = {
|
||||||
|
type = "string";
|
||||||
|
value = "${info.head.repo.name}";
|
||||||
|
emailresponsible = false;
|
||||||
|
};
|
||||||
|
gitea_repo_owner = {
|
||||||
|
type = "string";
|
||||||
|
value = "${info.head.repo.owner.username}";
|
||||||
|
emailresponsible = false;
|
||||||
|
};
|
||||||
|
gitea_http_url = {
|
||||||
|
type = "string";
|
||||||
|
value = "https://git.dynamicdiscord.de";
|
||||||
|
emailresponsible = false;
|
||||||
|
};
|
||||||
|
gitea_status_repo = {
|
||||||
|
type = "string";
|
||||||
|
value = "${info.head.ref}";
|
||||||
|
emailresponsible = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) prs;
|
||||||
|
mkFlakeJobset = branch: {
|
||||||
|
description = "Build ${branch} branch of the repo";
|
||||||
|
checkinterval = 300;
|
||||||
|
enabled = "1";
|
||||||
|
schedulingshares = 100;
|
||||||
|
enableemail = false;
|
||||||
|
emailoverride = "";
|
||||||
|
keepnr = 3;
|
||||||
|
hidden = false;
|
||||||
|
type = 1;
|
||||||
|
flake = "git+https://git.dynamicdiscord.de/kalipso/hydra-notify-test/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
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
45
.hydra/spec.json
Normal file
45
.hydra/spec.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"enabled": 1,
|
||||||
|
"hidden": false,
|
||||||
|
"description": "gitea notify test repo",
|
||||||
|
"nixexprinput": "nixexpr",
|
||||||
|
"flake" = "git+https://git.dynamicdiscord.de/kalipso/hydra-notify-test/archive/${branch}.tar.gz";
|
||||||
|
"checkinterval": 60,
|
||||||
|
"schedulingshares": 100,
|
||||||
|
"enableemail": false,
|
||||||
|
"emailoverride": "",
|
||||||
|
"keepnr": 5,
|
||||||
|
"type": 0,
|
||||||
|
"inputs": {
|
||||||
|
"hydra-notify-test": {
|
||||||
|
"value": "https://git.dynamicdiscord.de/kalipso/hydra-notify-test master",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"value": "https://github.com/NixOS/nixpkgs nixos-25.11",
|
||||||
|
"type": "git",
|
||||||
|
"emailresponsible": false
|
||||||
|
},
|
||||||
|
"gitea_repo_name" : {
|
||||||
|
"type" : "string",
|
||||||
|
"value" : "hydra-notify-test",
|
||||||
|
"emailresponsible" : false
|
||||||
|
},
|
||||||
|
"gitea_repo_owner" : {
|
||||||
|
"type" : "string",
|
||||||
|
"value" : "kalipso",
|
||||||
|
"emailresponsible" : false
|
||||||
|
},
|
||||||
|
gitea_http_url : {
|
||||||
|
"type" : "string",
|
||||||
|
"value" : "https://git.dynamicdiscord.de",
|
||||||
|
"emailresponsible" : false
|
||||||
|
},
|
||||||
|
gitea_status_repo : {
|
||||||
|
"type" : "string",
|
||||||
|
"value" : "hydra-notify-test",
|
||||||
|
"emailresponsible" : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
flake.nix
Normal file
15
flake.nix
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
description = "A very basic flake";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: {
|
||||||
|
|
||||||
|
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
|
||||||
|
|
||||||
|
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user