From 8ba0e72d2ef4876e36bd3614f93ab746fdd9ba53 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 11 May 2023 23:51:32 +0200 Subject: [PATCH] s/HOSTS/HOST/ --- Dockerfile | 1 - rsync-docker.sh | 8 +++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b800117..54f038d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,6 @@ RUN apt-get update -y && apt-get install -y \ build-essential \ locales \ rsync \ - keychain \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/rsync-docker.sh b/rsync-docker.sh index 4ff0508..b399ac0 100755 --- a/rsync-docker.sh +++ b/rsync-docker.sh @@ -14,22 +14,24 @@ set -x rsync::ssh() { : "${SSHKEY?Please provide a SSH Private Key (ED25519).}" : "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}" + : "${HOST?Destination Server}" pushd "${GITHUB_WORKSPACE}" + printf "Add SSH Private Key" mkdir ~/.ssh chmod 700 ~/.ssh echo "${SSHKEY}" | tee ~/.ssh/id_ed25519 > /dev/null chmod 400 ~/.ssh/id_ed25519 - # eval $(keychain --eval --quiet id_ed25519) + ssh-keyscan -t ed25519 "${HOST}" | tee -a ~/.ssh/known_hosts } rsync::transfer() { : "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}" : "${SOURCE?Define File to copy.}" : "${DESTINATION?Define File destination.}" - : "${HOSTS?Destination Server}" + : "${HOST?Destination Server}" : "${USER?Destination User}" pushd "${GITHUB_WORKSPACE}" - rsync --progress "${SOURCE}" "${USER}@${HOSTS}:${DESTINATION}" + rsync --progress "${SOURCE}" "${USER}@${HOST}:${DESTINATION}" } rsync::ssh