make deploy tests better

This commit is contained in:
Jörg Thalheim 2024-07-08 10:04:33 +02:00 committed by mergify[bot]
parent 519c800589
commit 50af56517d
2 changed files with 11 additions and 1 deletions

View File

@ -31,6 +31,7 @@
machine.wait_for_unit("phpfpm-mediawiki.service")
machine.wait_for_unit("nginx.service")
machine.wait_for_unit("mediawiki-init.service")
page = machine.succeed("curl -vL http://nixos-wiki.example.com/")
assert "MediaWiki has been installed" in page

View File

@ -1,6 +1,15 @@
#!/usr/bin/env bash
nix build .#checks.x86_64-linux.test .#nixosConfigurations.nixos-wiki-nixos-org.config.system.build.toplevel -L
set -euxo pipefail
nixBuild() {
if command -v nom -v &>/dev/null; then
nom build "$@"
else
nix build "$@"
fi
}
nixBuild .#checks.x86_64-linux.test .#nixosConfigurations.nixos-wiki-nixos-org.config.system.build.toplevel -L
if ! nixos-rebuild switch --flake .#nixos-wiki-nixos-org --target-host root@wiki.nixos.org; then
nixos-rebuild switch --flake .#nixos-wiki-nixos-org --target-host root@wiki.nixos.org
fi