s/HOSTS/HOST/
This commit is contained in:
parent
47b0deaf81
commit
8ba0e72d2e
2 changed files with 5 additions and 4 deletions
|
@ -11,7 +11,6 @@ RUN apt-get update -y && apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
locales \
|
locales \
|
||||||
rsync \
|
rsync \
|
||||||
keychain \
|
|
||||||
&& apt-get clean \
|
&& apt-get clean \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -14,22 +14,24 @@ set -x
|
||||||
rsync::ssh() {
|
rsync::ssh() {
|
||||||
: "${SSHKEY?Please provide a SSH Private Key (ED25519).}"
|
: "${SSHKEY?Please provide a SSH Private Key (ED25519).}"
|
||||||
: "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}"
|
: "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}"
|
||||||
|
: "${HOST?Destination Server}"
|
||||||
pushd "${GITHUB_WORKSPACE}"
|
pushd "${GITHUB_WORKSPACE}"
|
||||||
|
printf "Add SSH Private Key"
|
||||||
mkdir ~/.ssh
|
mkdir ~/.ssh
|
||||||
chmod 700 ~/.ssh
|
chmod 700 ~/.ssh
|
||||||
echo "${SSHKEY}" | tee ~/.ssh/id_ed25519 > /dev/null
|
echo "${SSHKEY}" | tee ~/.ssh/id_ed25519 > /dev/null
|
||||||
chmod 400 ~/.ssh/id_ed25519
|
chmod 400 ~/.ssh/id_ed25519
|
||||||
# eval $(keychain --eval --quiet id_ed25519)
|
ssh-keyscan -t ed25519 "${HOST}" | tee -a ~/.ssh/known_hosts
|
||||||
}
|
}
|
||||||
|
|
||||||
rsync::transfer() {
|
rsync::transfer() {
|
||||||
: "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}"
|
: "${GITHUB_WORKSPACE?GITHUB_WORKSPACE has to be set. Did you use the actions/checkout action?}"
|
||||||
: "${SOURCE?Define File to copy.}"
|
: "${SOURCE?Define File to copy.}"
|
||||||
: "${DESTINATION?Define File destination.}"
|
: "${DESTINATION?Define File destination.}"
|
||||||
: "${HOSTS?Destination Server}"
|
: "${HOST?Destination Server}"
|
||||||
: "${USER?Destination User}"
|
: "${USER?Destination User}"
|
||||||
pushd "${GITHUB_WORKSPACE}"
|
pushd "${GITHUB_WORKSPACE}"
|
||||||
rsync --progress "${SOURCE}" "${USER}@${HOSTS}:${DESTINATION}"
|
rsync --progress "${SOURCE}" "${USER}@${HOST}:${DESTINATION}"
|
||||||
}
|
}
|
||||||
|
|
||||||
rsync::ssh
|
rsync::ssh
|
||||||
|
|
Loading…
Reference in a new issue