mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 08:00:06 +01:00
WIP: test refactoring
This commit is contained in:
parent
8ad3b90a52
commit
bbc5e3d477
17 changed files with 714 additions and 66 deletions
46
modules/testing/docker.nix
Normal file
46
modules/testing/docker.nix
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
with import ../../lib/docker.nix { inherit lib pkgs; };
|
||||
|
||||
let
|
||||
testing = config.testing;
|
||||
|
||||
allImages = flatten (map (t: t.evaled.config.docker.export or []) testing.tests);
|
||||
|
||||
cfg = config.testing.docker;
|
||||
|
||||
in {
|
||||
options.testing.docker = {
|
||||
registryUrl = mkOption {
|
||||
description = "Docker registry url";
|
||||
type = types.str;
|
||||
};
|
||||
|
||||
images = mkOption {
|
||||
description = "List of images to export";
|
||||
type = types.listOf types.package;
|
||||
};
|
||||
|
||||
copyScript = mkOption {
|
||||
description = "Script to copy images to registry";
|
||||
type = types.package;
|
||||
};
|
||||
};
|
||||
|
||||
config.testing.docker = {
|
||||
images = allImages;
|
||||
|
||||
copyScript = copyDockerImages {
|
||||
images = cfg.images;
|
||||
dest = "docker://" + cfg.registryUrl;
|
||||
};
|
||||
};
|
||||
|
||||
config.testing.defaults = [{
|
||||
features = ["docker"];
|
||||
default = {
|
||||
docker.registry.url = cfg.registryUrl;
|
||||
};
|
||||
}];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue