Merge pull request 'deploy-docs: improve tempdir handling for ssh key' (#2270) from nixpkgs-fix into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/2270
This commit is contained in:
@@ -22,11 +22,13 @@ writeShellScriptBin "deploy-docs" ''
|
|||||||
# DO NOT PRINT THE SSH KEY TO THE LOGS #
|
# DO NOT PRINT THE SSH KEY TO THE LOGS #
|
||||||
# #
|
# #
|
||||||
#########################################
|
#########################################
|
||||||
set +x
|
tmpdir=$(mktemp -d)
|
||||||
if [ -n "''${SSH_HOMEPAGE_KEY:-}" ]; then
|
trap "rm -rf $tmpdir" EXIT
|
||||||
echo "$SSH_HOMEPAGE_KEY" > ./ssh_key
|
|
||||||
chmod 600 ./ssh_key
|
if [ -n "$SSH_HOMEPAGE_KEY" ]; then
|
||||||
sshExtraArgs="-i ./ssh_key"
|
echo "$SSH_HOMEPAGE_KEY" > "$tmpdir/ssh_key"
|
||||||
|
chmod 600 "$tmpdir/ssh_key"
|
||||||
|
sshExtraArgs="-i $tmpdir/ssh_key"
|
||||||
else
|
else
|
||||||
sshExtraArgs=
|
sshExtraArgs=
|
||||||
fi
|
fi
|
||||||
@@ -37,7 +39,6 @@ writeShellScriptBin "deploy-docs" ''
|
|||||||
# #
|
# #
|
||||||
###########################
|
###########################
|
||||||
|
|
||||||
|
|
||||||
rsync \
|
rsync \
|
||||||
-e "ssh -o StrictHostKeyChecking=no $sshExtraArgs" \
|
-e "ssh -o StrictHostKeyChecking=no $sshExtraArgs" \
|
||||||
-a ${docs}/ \
|
-a ${docs}/ \
|
||||||
|
|||||||
Reference in New Issue
Block a user