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.

drone-ssh-keys.sh 435B

123456789101112131415161718
  1. #!/bin/sh
  2. if [ -z "$SSH_PRIVATE_KEY" ] ; then
  3. echo "\$SSH_PRIVATE_KEY is not set!" >/dev/stderr
  4. exit 1
  5. fi
  6. if [ -z "$SSH_HOST_KEY" ] ; then
  7. echo "\$SSH_HOST_KEY is not set!" >/dev/stderr
  8. exit 1
  9. fi
  10. mkdir "${HOME}/.ssh"
  11. echo -n "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
  12. chmod 700 "${HOME}/.ssh/id_rsa"
  13. echo "${SSH_HOST_KEY}" >> "${HOME}/.ssh/known_hosts"
  14. echo "Created $HOME/.ssh/id_rsa and $HOME/.ssh/known_hosts"