diff options
author | lassulus <lassulus@lassul.us> | 2017-08-31 19:01:53 +0200 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2017-08-31 19:01:53 +0200 |
commit | 0bde01ddff0842122d17f886d7690c1dc9fc500a (patch) | |
tree | 228168619a001a33207b301613bebcdd48427ec7 | |
parent | 522f6c03cfaada59e4c571a735b5022acbc31c18 (diff) |
ci: replace users by hosts
-rw-r--r-- | krebs/2configs/buildbot-all.nix | 7 | ||||
-rw-r--r-- | krebs/2configs/buildbot-krebs.nix | 5 | ||||
-rw-r--r-- | krebs/3modules/ci.nix | 50 |
3 files changed, 13 insertions, 49 deletions
diff --git a/krebs/2configs/buildbot-all.nix b/krebs/2configs/buildbot-all.nix index acd806d6e..7344d9d18 100644 --- a/krebs/2configs/buildbot-all.nix +++ b/krebs/2configs/buildbot-all.nix @@ -1,3 +1,4 @@ +with import <stockholm/lib>; { lib, config, pkgs, ... }: { imports = [ @@ -7,10 +8,6 @@ networking.firewall.allowedTCPPorts = [ 80 8010 9989 ]; krebs.ci.enable = true; krebs.ci.treeStableTimer = 1; - krebs.ci.users.krebs.all = true; - krebs.ci.users.lass.all = true; - krebs.ci.users.makefu.all = true; - krebs.ci.users.nin.all = true; - krebs.ci.users.tv.all = true; + krebs.ci.hosts = filter (getAttr "managed") (attrValues config.krebs.hosts); } diff --git a/krebs/2configs/buildbot-krebs.nix b/krebs/2configs/buildbot-krebs.nix index 40ca3c66d..a09b3b98b 100644 --- a/krebs/2configs/buildbot-krebs.nix +++ b/krebs/2configs/buildbot-krebs.nix @@ -1,3 +1,4 @@ +with import <stockholm/lib>; { lib, config, pkgs, ... }: { imports = [ @@ -7,7 +8,5 @@ networking.firewall.allowedTCPPorts = [ 80 8010 9989 ]; krebs.ci.enable = true; krebs.ci.treeStableTimer = 120; - krebs.ci.users.krebs.hosts = [ - config.networking.hostName - ]; + krebs.ci.hosts = [ config.krebs.build.host ]; } diff --git a/krebs/3modules/ci.nix b/krebs/3modules/ci.nix index b55827e3a..dab87792e 100644 --- a/krebs/3modules/ci.nix +++ b/krebs/3modules/ci.nix @@ -17,30 +17,12 @@ in default = 10; description = "how long to wait until we test changes (in minutes)"; }; - users = mkOption { - type = with types; attrsOf (submodule { - options = { - all = mkOption { - type = bool; - default = false; - }; - hosts = mkOption { - type = listOf str; - default = []; - }; - }; - }); - example = { - lass.all = true; - krebs = { - all = true; - hosts = [ - "test-all-krebs-modules" - "test-arch" - ]; - }; - }; - default = {}; + hosts = mkOption { + type = types.listOf types.host; + default = []; + description = '' + List of hosts that should be build + ''; }; }; @@ -132,23 +114,9 @@ in timeout=90001 ) - ${let - user-hosts = mapAttrs (user: a: let - managed-hosts = attrNames (filterAttrs (_: h: (h.owner.name == user) && h.managed) config.krebs.hosts); - defined-hosts = a.hosts; - in - defined-hosts ++ (optionals a.all managed-hosts) - ) cfg.users; - - in - concatStringsSep "\n" ( - (mapAttrsToList (user: hosts: - concatMapStringsSep "\n" (host: - "build_host(\"${user}\", \"${host}\")" - ) hosts - ) user-hosts) - ) - } + ${concatMapStringsSep "\n" (host: + "build_host(\"${host.owner.name}\", \"${host.name}\")" + ) cfg.hosts} bu.append( util.BuilderConfig( |