synchronize
This commit is contained in:
parent
dffda8c1ec
commit
245a071852
1 changed files with 0 additions and 0 deletions
23
cd-synchronize
Executable file
23
cd-synchronize
Executable file
|
@ -0,0 +1,23 @@
|
|||
[ "${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}/"
|
Loading…
Add table
Add a link
Reference in a new issue