diff options
author | Antoine Eiche <lewo@abesis.fr> | 2020-04-18 01:03:15 +0200 |
---|---|---|
committer | Antoine Eiche <lewo@abesis.fr> | 2020-04-19 10:01:57 +0200 |
commit | 2493056eed1ee5afcab24403c21e028971207531 (patch) | |
tree | 6ae82c76a63589f9e1f7c89ce8ca5aa422985a9e /.hydra | |
parent | 09ca79801b7d030cedfe8ca20984580433a6accc (diff) |
Setup an Hydra declarative project
This commit adds configuration files ingested an Hydra instance to
create a declarative project.
Currently, this Hydra instance builds
- the master branch
- all pull requests
We use the nix community provided Hydra instance
https://hydra.nix-community.org/project/simple-nixos-mailserver.
Diffstat (limited to '.hydra')
-rw-r--r-- | .hydra/declarative-jobsets.nix | 58 | ||||
-rw-r--r-- | .hydra/default.nix | 1 | ||||
-rw-r--r-- | .hydra/spec.json | 30 |
3 files changed, 89 insertions, 0 deletions
diff --git a/.hydra/declarative-jobsets.nix b/.hydra/declarative-jobsets.nix new file mode 100644 index 0000000..7ddb159 --- /dev/null +++ b/.hydra/declarative-jobsets.nix @@ -0,0 +1,58 @@ +{ 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 = { + cloudwatt = { + 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; + }; + }; + }; + }; + +in { + jobsets = pkgs.runCommand "spec-jobsets.json" {} '' + cat >$out <<EOF + ${builtins.toJSON desc} + EOF + ''; +} diff --git a/.hydra/default.nix b/.hydra/default.nix new file mode 100644 index 0000000..d41b14f --- /dev/null +++ b/.hydra/default.nix @@ -0,0 +1 @@ +import ../tests diff --git a/.hydra/spec.json b/.hydra/spec.json new file mode 100644 index 0000000..79f9f0b --- /dev/null +++ b/.hydra/spec.json @@ -0,0 +1,30 @@ +{ + "enabled": 1, + "hidden": false, + "description": "Simple NixOS Mailserver", + "nixexprinput": "nixexpr", + "nixexprpath": ".hydra/declarative-jobsets.nix", + "checkinterval": 60, + "schedulingshares": 100, + "enableemail": false, + "emailoverride": "", + "keepnr": 3, + "type": 0, + "inputs": { + "nixexpr": { + "value": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver master", + "type": "git", + "emailresponsible": false + }, + "nixpkgs": { + "value": "https://github.com/NixOS/nixpkgs 0f920b05cbcdb8c0f3c5c4a8ea29f1f0065c7033 ", + "type": "git", + "emailresponsible": false + }, + "pulls": { + "type": "gitlabpulls", + "value": "https://gitlab.com 7219050", + "emailresponsible": false + } + } +} |