Test and deploy

This commit is contained in:
Gabriel DORIATH DOHLER 2021-07-28 23:31:57 +02:00
parent 9207580a39
commit 63edbed11f
3 changed files with 17 additions and 11 deletions

View file

@ -15,5 +15,9 @@ steps:
commands:
- "export NIX_PATH=nixpkgs=/var/nixpkgs"
- "echo Building core-services-01 && nix-build krops.nix -A test-core-services-01 && ./result"
- name: Build remote-builder-01 configuration
commands:
- "export NIX_PATH=nixpkgs=/var/nixpkgs"
- "echo Building remote-builder-01 && nix-build krops.nix -A remote-builder-01 && ./result"
...

View file

@ -5,6 +5,7 @@
Refer to wiki for details.
- `core-services-01`
- `remote-builder-01`
## How to deploy a machine?

View file

@ -15,20 +15,21 @@ let
};
}
];
in
{
core-services-01 = pkgs.krops.writeDeploy "deploy-core-services-01" {
source = source "core-services-01";
target = "root@core01.internal.rz.ens.wtf";
};
test-core-services-01 = pkgs.krops.writeTest "test-core-services-01" {
source = source "core-services-01";
mkTestConfig = hostname:
test-${hostname}-01 = pkgs.krops.writeTest "test-${hostname}" {
source = source hostname;
target = lib.mkTarget {
host = "localhost";
path = "/tmp/src";
};
force = true; # force create the sentinel file.
};
}
mkTestsConfig = hostnames:
builtins.listToAttrs (map (h: { name = h; value = mkTestConfig h; }) hostnames)
in
{
core-services-01 = pkgs.krops.writeDeploy "deploy-core-services-01" {
source = source "core-services-01";
target = "root@core01.internal.rz.ens.wtf";
};
} // mkTestsConfig [ "core-services-01" "remote-builder-01" ];