Fediversity/deployment/check/data-model-tf/nixosTest.nix
Kiara Grouwstra e30b052cfc
Some checks failed
deploy-infra / deploy (push) Successful in 2m8s
/ check-pre-commit (push) Failing after 14s
/ check-data-model (push) Successful in 30s
/ check-mastodon (push) Successful in 22s
/ check-peertube (push) Successful in 21s
/ check-panel (push) Successful in 1m32s
/ check-proxmox-basic (push) Successful in 35s
/ check-deployment-basic (push) Successful in 33s
/ check-deployment-cli (push) Successful in 43s
/ check-deployment-panel (push) Successful in 1m53s
/ check-deployment-model (push) Successful in 24s
/ check-deployment-model-ssh (push) Successful in 4s
/ check-deployment-model-nixops4 (push) Successful in 33s
/ check-deployment-model-tf (push) Successful in 25s
/ check-resources (push) Successful in 3m56s
ensure path availability in deployments (#511)
Reviewed-on: #511
2025-09-03 17:15:35 +02:00

61 lines
1.3 KiB
Nix

{
lib,
pkgs,
...
}:
let
inherit (import ./constants.nix) pathToRoot pathFromRoot;
inherit (pkgs) system;
deployment-config = {
inherit pathToRoot pathFromRoot;
nodeName = "target";
targetSystem = system;
sshOpts = [ ];
};
deploy =
(import ../common/data-model.nix {
inherit system;
config = deployment-config;
# opt not to pass `inputs`, as we could only pass serializable arguments through to its self-call
})."tf-deployment".tf-host.run;
in
{
_class = "nixosTest";
imports = [
../common/data-model-options.nix
];
name = "deployment-model";
sourceFileset = lib.fileset.unions [
../../run/tf-single-host/run.sh
];
nodes.deployer =
{ ... }:
{
environment.systemPackages = [
deploy
];
# needed only when building from deployer
system.extraDependenciesFromModule =
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
hello
];
};
};
extraTestScript = ''
with subtest("Check the status before deployment"):
target.fail("hello 1>&2")
with subtest("Run the deployment"):
deployer.succeed("""
${lib.getExe deploy}
""")
target.wait_for_unit("multi-user.target")
target.succeed("su - operator -c hello 1>&2")
'';
}