Skip to content

Instantly share code, notes, and snippets.

@cransom
Created December 19, 2017 19:11
Show Gist options
  • Save cransom/63770f5bd0dac5ffb593269f5987f0b5 to your computer and use it in GitHub Desktop.
Save cransom/63770f5bd0dac5ffb593269f5987f0b5 to your computer and use it in GitHub Desktop.
{ repoPrs, writeText }:
let
inherit (builtins) fromJSON toJSON readFile attrNames map;
prs = fromJSON (readFile repoPrs);
nixpkgs = (import ../etc/lib/version.nix);
prIds = attrNames prs;
genJobSet = id:
let
info = prs."${id}";
in {
enabled = 1;
hidden = false;
description = "PR ${id}: ${info.title}";
nixexprinput = "repoGit";
nixexprpath = "z/ci/release.nix";
checkinterval = 30;
schedulingshares = 10;
enableemail = false;
emailoverride = "";
keepnr = 5;
inputs = {
prGit = {
type = "git";
value = "git@github.com:${info.head.repo.owner.login}/${info.head.repo.name}.git ${info.head.ref}";
emailresponsible = false;
};
officialRelease = {
type = "boolean";
value = false;
};
nixpkgs = {
type = "git";
value = "${nixpkgs.url} ${nixpkgs.rev}";
emailresponsible = false;
};
officialRelease = {
type = "boolean";
value = false;
};
};
jobsets = map genJobSet prIds;
in {
jobsets = writeText "spec.json" (toJSON jobsets);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment