From 6950125511c892a2de45d4d138ceb851652fa2c2 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 6 Nov 2020 09:10:13 -0500 Subject: [PATCH] rename ssh_key to DRONE_SSH_KEY --- posix/clone | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/posix/clone b/posix/clone index 156c397..c197f73 100755 --- a/posix/clone +++ b/posix/clone @@ -15,22 +15,13 @@ password ${DRONE_NETRC_PASSWORD} EOF fi -# Either of SSH_KEY or DRONE_SSH_KEY environment variable represents ssh key. -# DRONE_SSH_KEY variable is introduced to avoid collision with the user provided -# environment variable which can be same as SSH_KEY - -ssh_key=$DRONE_SSH_KEY -if [[ -z "${ssh_key}" ]]; then - ssh_key=$SSH_KEY -fi - # if the ssh_key environment variable exists, write # the ssh key and add the netrc machine to the # known hosts file. -if [[ ! -z "${ssh_key}" ]]; then +if [[ ! -z "${DRONE_SSH_KEY}" ]]; then mkdir /root/.ssh - echo -n "$ssh_key" > /root/.ssh/id_rsa + echo -n "$DRONE_SSH_KEY" > /root/.ssh/id_rsa chmod 600 /root/.ssh/id_rsa touch /root/.ssh/known_hosts