kubenix/examples/nginx-deployment/default.nix

47 lines
916 B
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 {
2019-03-07 18:03:51 +01:00
modules = [
2021-05-28 20:26:17 -05:00
({ kubenix, ... }: { imports = [ kubenix.modules.testing ]; })
2019-03-07 18:03:51 +01:00
./module.nix
2021-05-28 20:26:17 -05:00
{ docker.registry.url = registry; }
{
testing.tests = [ ./test.nix ];
2021-05-28 20:26:17 -05:00
testing.docker.registryUrl = "";
}
2021-05-28 20:26:17 -05:00
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
}