-
-
Save ocharles/af08b39e472cd504d2a4d6e2ef679002 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ nixpkgs ? <nixpkgs> | |
, declInput ? {} | |
, pullRequests | |
}: | |
let | |
pkgs = import nixpkgs {}; | |
build-client = | |
{ description, github }: | |
{ | |
inherit description; | |
enabled = 1; | |
hidden = false; | |
nixexprpath = "jobs.nix"; | |
nixexprinput = "client"; | |
checkinterval = 5; | |
schedulingshares = 100; | |
enableemail = false; | |
emailoverride = ""; | |
keepnr = 3; | |
inputs = { | |
client = { | |
type = "git"; | |
value = "https://XXX:x-oauth-basic@github.com/${github.owner}/${github.repo} ${github.ref}"; | |
emailresponsible = false; | |
}; | |
nixpkgs = { | |
type = "git"; | |
value = "git://github.com/nixos/nixpkgs-channels nixos-17.09"; | |
emailresponsible = false; | |
}; | |
}; | |
}; | |
build-pull-request = | |
num: info: | |
{ | |
name = "client-pr-${num}"; | |
value = | |
build-client | |
{ | |
description = "PR #${num}: ${info.title}"; | |
github = { | |
owner = info.head.repo.owner.login; | |
repo = info.head.repo.name; | |
ref = info.head.ref; | |
}; | |
}; | |
}; | |
prJobsets = | |
pkgs.lib.listToAttrs | |
( pkgs.lib.mapAttrsToList build-pull-request | |
(builtins.fromJSON (builtins.readFile pullRequests))); | |
jobsetAttrs = { | |
master = | |
build-client { | |
description = "master"; | |
github = { | |
owner = "circuithub"; | |
repo = "circuithub-client"; | |
ref = ""; | |
}; | |
}; | |
} // prJobsets; | |
in | |
{ jobsets = pkgs.writeText "spec.json" (builtins.toJSON jobsetAttrs); } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"enabled": 1, | |
"hidden": false, | |
"description": "CircuitHub's web interface", | |
"nixexprinput": "client", | |
"nixexprpath": "hydra-jobsets.nix", | |
"checkinterval": 5, | |
"schedulingshares": 100, | |
"enableemail": false, | |
"emailoverride": "", | |
"keepnr": 3, | |
"inputs": { | |
"client": { | |
"type": "git", | |
"value": "https://XXX:x-oauth-basic@github.com/circuithub/circuithub-client", | |
"emailresponsible": false | |
}, | |
"nixpkgs": { | |
"type": "git", | |
"value": "git://github.com/NixOS/nixpkgs.git release-17.09", | |
"emailresponsible": false | |
}, | |
"pullRequests": { | |
"type": "githubpulls", | |
"value": "circuithub circuithub-client", | |
"emailresponsible": false | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment