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: commands:
- "export NIX_PATH=nixpkgs=/var/nixpkgs" - "export NIX_PATH=nixpkgs=/var/nixpkgs"
- "echo Building core-services-01 && nix-build krops.nix -A test-core-services-01 && ./result" - "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. Refer to wiki for details.
- `core-services-01` - `core-services-01`
- `remote-builder-01`
## How to deploy a machine? ## How to deploy a machine?

View file

@ -15,20 +15,21 @@ let
}; };
} }
]; ];
in mkTestConfig = hostname:
{ test-${hostname}-01 = pkgs.krops.writeTest "test-${hostname}" {
core-services-01 = pkgs.krops.writeDeploy "deploy-core-services-01" { source = source hostname;
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";
target = lib.mkTarget { target = lib.mkTarget {
host = "localhost"; host = "localhost";
path = "/tmp/src"; path = "/tmp/src";
}; };
force = true; # force create the sentinel file. 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" ];