diff --git a/.drone.yml b/.drone.yml index 5feb66e..fda39a8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -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" ... diff --git a/README.md b/README.md index d608944..0a227f8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Refer to wiki for details. - `core-services-01` +- `remote-builder-01` ## How to deploy a machine? diff --git a/krops.nix b/krops.nix index 17ba000..cbcc956 100644 --- a/krops.nix +++ b/krops.nix @@ -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" ];