forked from Fediversity/Fediversity
50 lines
977 B
Nix
50 lines
977 B
Nix
{
|
|
lib,
|
|
...
|
|
}:
|
|
|
|
{
|
|
_class = "nixosTest";
|
|
|
|
name = "deployment-model";
|
|
|
|
sourceFileset = lib.fileset.unions [
|
|
../../data-model.nix
|
|
../../function.nix
|
|
./constants.nix
|
|
./deployment.nix
|
|
];
|
|
|
|
nodes.deployer =
|
|
{ pkgs, ... }:
|
|
{
|
|
|
|
# FIXME: sad times
|
|
system.extraDependencies = with pkgs; [
|
|
jq
|
|
jq.inputDerivation
|
|
];
|
|
|
|
system.extraDependenciesFromModule =
|
|
{ pkgs, ... }:
|
|
{
|
|
environment.systemPackages = with pkgs; [
|
|
hello
|
|
cowsay
|
|
];
|
|
};
|
|
};
|
|
|
|
extraTestScript = ''
|
|
with subtest("Check the status before deployment"):
|
|
hello.fail("hello 1>&2")
|
|
cowsay.fail("cowsay 1>&2")
|
|
|
|
with subtest("Run the deployment"):
|
|
deployer.succeed("nixops4 apply check-deployment-basic --show-trace --no-interactive 1>&2")
|
|
|
|
with subtest("Check the deployment"):
|
|
hello.succeed("hello 1>&2")
|
|
cowsay.succeed("cowsay hi 1>&2")
|
|
'';
|
|
}
|