propagate exit code in publish-docs script

This commit is contained in:
Dan Allen 2022-09-09 16:06:36 -06:00 committed by Steve Riesenberg
parent 79a23b8b27
commit 6bd10b4056
1 changed files with 11 additions and 4 deletions

View File

@ -11,8 +11,15 @@ if [ "$#" -ne 4 ]; then
exit 1
fi
install -m 600 -D /dev/null "$SSH_PRIVATE_KEY_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVATE_KEY_PATH"
echo "$SSH_KNOWN_HOST" > ~/.ssh/known_hosts
rsync --delete -avze "ssh -i $SSH_PRIVATE_KEY_PATH" build/site/ "$HOST:$HOST_PATH"
(
set -e
install -m 600 -D /dev/null "$SSH_PRIVATE_KEY_PATH"
echo "$SSH_PRIVATE_KEY" > "$SSH_PRIVATE_KEY_PATH"
echo "$SSH_KNOWN_HOST" > ~/.ssh/known_hosts
rsync --delete -avze "ssh -i $SSH_PRIVATE_KEY_PATH" build/site/ "$HOST:$HOST_PATH"
)
exit_code=$?
rm -f "$SSH_PRIVATE_KEY_PATH"
exit $exit_code