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
This commit is contained in:
Thiago Alves Cavalcante 2020-05-21 19:10:23 -03:00 committed by GitHub
parent 0ff9b46136
commit 05e56fde67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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