fix(deploy): continue after apply error

This commit is contained in:
oddlama 2023-10-16 18:12:49 +02:00
parent 5bcf5c8100
commit 862cd1c7b5
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -102,8 +102,10 @@
store_path="''${TOPLEVEL_STORE_PATHS["$host"]}"
echo " Applying  $host"
prev_system=$(ssh "$host" -- readlink -e /nix/var/nix/profiles/system)
ssh "$host" -- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$store_path"
ssh "$host" -- "$store_path"/bin/switch-to-configuration "$ACTION"
ssh "$host" -- /run/current-system/sw/bin/nix-env --profile /nix/var/nix/profiles/system --set "$store_path" \
|| die "Failed to set system profile"
ssh "$host" -- "$store_path"/bin/switch-to-configuration "$ACTION" \
|| echo "Error while activating new system" >&2
if [[ -n "$prev_system" ]]; then
ssh "$host" -- nvd --color always diff "$prev_system" "$store_path"
fi