scripts/deploy: skip the signing step if we have no signing key

This commit is contained in:
Colin 2024-06-12 07:11:14 +00:00
parent c9b2699c9f
commit 406adde549

View File

@ -70,7 +70,11 @@ storePath="$(readlink ./build/result-$host$variant)"
# - sandbox friendliness (especially: `git` doesn't have to be run as root)
if [ -n "$host" ]; then
sudo nix store sign -r -k /run/secrets/nix_signing_key "$storePath"
if [ -e /run/secrets/nix_signing_key ]; then
sudo nix store sign -r -k /run/secrets/nix_signing_key "$storePath"
else
echo "not signing store paths: /run/secrets/nix_signing_key does not exist"
fi
# add more `-v` for more verbosity (up to 5).
# builders-use-substitutes false: optimizes so that the remote machine doesn't try to get paths from its substituters.
# we already have all paths here, and the remote substitution is slow to check and SERIOUSLY flaky on moby in particular.