From 19c41760153494189135cb5aa75f968bbbd19493 Mon Sep 17 00:00:00 2001 From: sinavir Date: Sun, 7 Jan 2024 10:20:46 +0100 Subject: [PATCH] fix(check-deployment): fix nvd invocation and diff flag --- scripts/check-deployment.sh | 6 +++--- scripts/default.nix | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/check-deployment.sh b/scripts/check-deployment.sh index d07d522..652a274 100644 --- a/scripts/check-deployment.sh +++ b/scripts/check-deployment.sh @@ -13,7 +13,7 @@ By default check all nodes where: -h Show this help text - --dryrun Print the nixos-anywhere invocation + --diff Show diff with nvd Exemple: check-deployment web01" @@ -96,9 +96,9 @@ while IFS=$'\n' read -r c; do if [ "$expected_path" == "$current_path" ] ; then echo "$machine -> OK" - elif [[ -z ${diff-} ]] ; then - nix-store -r "$drv_path" + elif [[ -n ${diff-} ]] ; then nix-copy-closure --from "root@$domain" "$current_path" + nix-store -r "$drv_path" echo "$machine -> error. nvd output:" @nvd@/bin/nvd diff "$expected_path" "$current_path" return_status=1 diff --git a/scripts/default.nix b/scripts/default.nix index 0929d2a..3044c23 100644 --- a/scripts/default.nix +++ b/scripts/default.nix @@ -6,6 +6,7 @@ let bash colmena coreutils + nvd git jq; };