2020-04-17 23:03:15 +00:00
|
|
|
{ nixpkgs, declInput, 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}";
|
|
|
|
nixexprinput = "snm";
|
|
|
|
nixexprpath = ".hydra/default.nix";
|
|
|
|
checkinterval = 30;
|
|
|
|
schedulingshares = 20;
|
|
|
|
enableemail = false;
|
|
|
|
emailoverride = "";
|
|
|
|
keepnr = 1;
|
|
|
|
type = 0;
|
|
|
|
inputs = {
|
2020-04-19 12:59:01 +00:00
|
|
|
snm = {
|
2020-04-17 23:03:15 +00:00
|
|
|
type = "git";
|
|
|
|
value = "${info.target_repo_url} merge-requests/${info.iid}/head";
|
|
|
|
emailresponsible = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
) prs;
|
|
|
|
|
|
|
|
desc = prJobsets // {
|
|
|
|
master = {
|
|
|
|
description = "Build master branch of Simple NixOS MailServer";
|
|
|
|
checkinterval = "60";
|
|
|
|
enabled = "1";
|
|
|
|
nixexprinput = "snm";
|
|
|
|
nixexprpath = ".hydra/default.nix";
|
|
|
|
schedulingshares = 100;
|
|
|
|
enableemail = false;
|
|
|
|
emailoverride = "";
|
|
|
|
keepnr = 3;
|
|
|
|
hidden = false;
|
|
|
|
type = 0;
|
|
|
|
inputs = {
|
|
|
|
snm = {
|
|
|
|
value = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver master";
|
|
|
|
type = "git";
|
|
|
|
emailresponsible = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2020-05-05 19:03:10 +00:00
|
|
|
"nixos-19.09" = {
|
|
|
|
description = "Build the nixos-19.09 branch of Simple NixOS MailServer";
|
|
|
|
checkinterval = "60";
|
|
|
|
enabled = "1";
|
|
|
|
nixexprinput = "snm";
|
|
|
|
nixexprpath = ".hydra/default.nix";
|
|
|
|
schedulingshares = 100;
|
|
|
|
enableemail = false;
|
|
|
|
emailoverride = "";
|
|
|
|
keepnr = 3;
|
|
|
|
hidden = false;
|
|
|
|
type = 0;
|
|
|
|
inputs = {
|
|
|
|
snm = {
|
|
|
|
value = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver nixos-19.09";
|
|
|
|
type = "git";
|
|
|
|
emailresponsible = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2020-04-17 23:03:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
jobsets = pkgs.runCommand "spec-jobsets.json" {} ''
|
|
|
|
cat >$out <<EOF
|
|
|
|
${builtins.toJSON desc}
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
}
|