A Docker image for rsync+ssh deploys using Drone.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
435 B

#!/bin/sh
if [ -z "$SSH_PRIVATE_KEY" ] ; then
echo "\$SSH_PRIVATE_KEY is not set!" >/dev/stderr
exit 1
fi
if [ -z "$SSH_HOST_KEY" ] ; then
echo "\$SSH_HOST_KEY is not set!" >/dev/stderr
exit 1
fi
mkdir "${HOME}/.ssh"
echo -n "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
chmod 700 "${HOME}/.ssh/id_rsa"
echo "${SSH_HOST_KEY}" >> "${HOME}/.ssh/known_hosts"
echo "Created $HOME/.ssh/id_rsa and $HOME/.ssh/known_hosts"