From 05e56fde67776db6b60dd71f4091ec9ccfac4396 Mon Sep 17 00:00:00 2001 From: Thiago Alves Cavalcante Date: Thu, 21 May 2020 19:10:23 -0300 Subject: [PATCH] Update rsync command (#150) * Update rsync command Adds --no-perms --no-owner params to rsync command for maintain compatibility with NFS volumes, else rsync change owner and perms of files synced causing error. * Change params on rsync to a generic variable * Add params as string on generic var * remove duplicated generic var * Remove double quotes on rsync command * Add a coment to ignore spellcheck --- containers/zammad/docker-entrypoint.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index 7917a42..62a87de 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -21,6 +21,7 @@ set -e : "${ZAMMAD_WEBSOCKET_HOST:=zammad-websocket}" : "${ZAMMAD_WEBSOCKET_PORT:=6042}" : "${NGINX_SERVER_NAME:=_}" +: "${RSYNC_ADDITIONAL_PARAMS:=--no-perms --no-owner}" function check_zammad_ready { sleep 15 @@ -34,8 +35,10 @@ function check_zammad_ready { if [ "$1" = 'zammad-init' ]; then # install / update zammad test -f "${ZAMMAD_READY_FILE}" && rm "${ZAMMAD_READY_FILE}" - rsync -a --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' "${ZAMMAD_TMP_DIR}/" "${ZAMMAD_DIR}" - rsync -a "${ZAMMAD_TMP_DIR}"/public/assets/images/ "${ZAMMAD_DIR}"/public/assets/images + # shellcheck disable=SC2086 + rsync -a ${RSYNC_ADDITIONAL_PARAMS} --delete --exclude 'public/assets/images/*' --exclude 'storage/fs/*' "${ZAMMAD_TMP_DIR}/" "${ZAMMAD_DIR}" + # shellcheck disable=SC2086 + rsync -a ${RSYNC_ADDITIONAL_PARAMS} "${ZAMMAD_TMP_DIR}"/public/assets/images/ "${ZAMMAD_DIR}"/public/assets/images until (echo > /dev/tcp/"${POSTGRESQL_HOST}"/"${POSTGRESQL_PORT}") &> /dev/null; do echo "zammad railsserver waiting for postgresql server to be ready..."