synchronize/wip
All checks were successful
/ job (push) Successful in 1m20s

This commit is contained in:
Marc Beninca 2024-06-01 15:25:23 +02:00
parent 2c3f55ec90
commit 9e8dd694d9
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 20 additions and 24 deletions

View file

@ -1,23 +0,0 @@
[ "${1}" ] && SYNC_SOURCE="${1}" || exit
SYNC_USER='cd'
[ "${GITHUB_SERVER_URL}" ] \
&& SYNC_HOST="$(basename ${GITHUB_SERVER_URL})" || exit
[ "${SYNC_USER}" ] \
&& SYNC_ROOT="/${SYNC_USER}" || exit
[ "${GITHUB_REF_NAME}" ] \
&& SYNC_ROOT="${SYNC_ROOT}/${GITHUB_REF_NAME}" || exit
[ "${GITHUB_REPOSITORY}" ] \
&& SYNC_ROOT="${SYNC_ROOT}/${GITHUB_REPOSITORY}" || exit
SYNC_TARGET="${SYNC_USER}@${SYNC_HOST}:${SYNC_ROOT}"
[ "${2}" ] && SYNC_TARGET="${SYNC_TARGET}/${2}"
rsync \
--archive \
--delete-before \
--verbose \
"${SYNC_SOURCE}/" \
"${SYNC_TARGET}/"