kubenix/examples/nginx-deployment/default.nix

59 lines
1.3 KiB
Nix
Raw Normal View History

2021-05-28 20:26:17 -05:00
{ evalModules, registry }:
2019-03-07 18:03:51 +01:00
2021-05-28 20:26:17 -05:00
let
2019-03-07 18:03:51 +01:00
# evaluated configuration
2021-05-28 20:26:17 -05:00
config = (evalModules {
module =
{ kubenix, ... }: {
imports = [
kubenix.modules.testing
./module.nix
];
# commonalities
kubenix.project = "nginx-deployment-example";
docker.registry.url = registry;
kubernetes.version = "1.21";
testing = {
tests = [ ./test.nix ];
docker.registryUrl = "";
# testing commonalities for tests that exhibit the respective feature
defaults = [
{
features = [ "k8s" ];
default = {
kubernetes.version = "1.20";
};
}
];
};
};
2019-03-07 18:03:51 +01:00
}).config;
2021-05-28 20:26:17 -05:00
in
{
inherit config;
# config checks
checks = config.testing.success;
# TODO: e2e test
# test = config.testing.result;
# nixos test script for running the test
2021-05-28 20:26:17 -05:00
test-script = config.testing.testsByName.nginx-deployment.script;
2019-03-07 18:03:51 +01:00
2020-01-14 19:13:33 +00:00
# genreated kubernetes List object
generated = config.kubernetes.generated;
2019-03-07 18:03:51 +01:00
2020-01-14 19:13:33 +00:00
# JSON file you can deploy to kubernetes
result = config.kubernetes.result;
2019-03-07 18:03:51 +01:00
# Exported docker images
images = config.docker.export;
# script to push docker images to registry
pushDockerImages = config.docker.copyScript;
2019-03-07 18:03:51 +01:00
}