s/HOSTS/HOST/
All checks were successful
hadolint Dockerfile / build (push) Successful in 8s
shellchecking ansible-docker.sh / build (push) Successful in 13s
Yamllint GitHub Actions / Yamllint (push) Successful in 9s

This commit is contained in:
L3D 2023-05-11 23:51:32 +02:00
parent 47b0deaf81
commit 8ba0e72d2e
No known key found for this signature in database
GPG key ID: AD65B920933B4B20
2 changed files with 5 additions and 4 deletions

View file

@ -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/*

View file

@ -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