ci: replace users by hosts

This commit is contained in:
lassulus 2017-08-31 19:01:53 +02:00
parent 522f6c03cf
commit 0bde01ddff
3 changed files with 13 additions and 49 deletions

View File

@ -1,3 +1,4 @@
with import <stockholm/lib>;
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
imports = [ imports = [
@ -7,10 +8,6 @@
networking.firewall.allowedTCPPorts = [ 80 8010 9989 ]; networking.firewall.allowedTCPPorts = [ 80 8010 9989 ];
krebs.ci.enable = true; krebs.ci.enable = true;
krebs.ci.treeStableTimer = 1; krebs.ci.treeStableTimer = 1;
krebs.ci.users.krebs.all = true; krebs.ci.hosts = filter (getAttr "managed") (attrValues config.krebs.hosts);
krebs.ci.users.lass.all = true;
krebs.ci.users.makefu.all = true;
krebs.ci.users.nin.all = true;
krebs.ci.users.tv.all = true;
} }

View File

@ -1,3 +1,4 @@
with import <stockholm/lib>;
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
{ {
imports = [ imports = [
@ -7,7 +8,5 @@
networking.firewall.allowedTCPPorts = [ 80 8010 9989 ]; networking.firewall.allowedTCPPorts = [ 80 8010 9989 ];
krebs.ci.enable = true; krebs.ci.enable = true;
krebs.ci.treeStableTimer = 120; krebs.ci.treeStableTimer = 120;
krebs.ci.users.krebs.hosts = [ krebs.ci.hosts = [ config.krebs.build.host ];
config.networking.hostName
];
} }

View File

@ -17,30 +17,12 @@ in
default = 10; default = 10;
description = "how long to wait until we test changes (in minutes)"; 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 { hosts = mkOption {
type = listOf str; type = types.listOf types.host;
default = []; default = [];
}; description = ''
}; List of hosts that should be build
}); '';
example = {
lass.all = true;
krebs = {
all = true;
hosts = [
"test-all-krebs-modules"
"test-arch"
];
};
};
default = {};
}; };
}; };
@ -132,23 +114,9 @@ in
timeout=90001 timeout=90001
) )
${let ${concatMapStringsSep "\n" (host:
user-hosts = mapAttrs (user: a: let "build_host(\"${host.owner.name}\", \"${host.name}\")"
managed-hosts = attrNames (filterAttrs (_: h: (h.owner.name == user) && h.managed) config.krebs.hosts); ) cfg.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)
)
}
bu.append( bu.append(
util.BuilderConfig( util.BuilderConfig(