From e6033719843f38cecb9d16341b15d19e548f7eea Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 16 Sep 2020 14:20:10 +0530 Subject: [PATCH] fix(frappe-worker): set absolute path of common_site_config.json in healthcheck.sh --- build/common/worker/healthcheck.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/common/worker/healthcheck.sh b/build/common/worker/healthcheck.sh index 32192f93..f64d1a49 100755 --- a/build/common/worker/healthcheck.sh +++ b/build/common/worker/healthcheck.sh @@ -1,16 +1,18 @@ #!/bin/bash +export COMMON_SITE_CONFIG_JSON='/home/frappe/frappe-bench/sites/common_site_config.json' + # Set DB Host and port -export DB_HOST=`cat ./common_site_config.json | awk '/db_host/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'` -export DB_PORT=`cat ./common_site_config.json | awk '/db_port/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'` +export DB_HOST=`cat $COMMON_SITE_CONFIG_JSON | awk '/db_host/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'` +export DB_PORT=`cat $COMMON_SITE_CONFIG_JSON | awk '/db_port/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n'` if [[ -z "$DB_PORT" ]]; then export DB_PORT=3306 fi # Set REDIS host:port -export REDIS_CACHE=`cat ./common_site_config.json | awk '/redis_cache/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` -export REDIS_QUEUE=`cat ./common_site_config.json | awk '/redis_queue/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` -export REDIS_SOCKETIO=`cat ./common_site_config.json | awk '/redis_socketio/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` +export REDIS_CACHE=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_cache/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` +export REDIS_QUEUE=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_queue/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` +export REDIS_SOCKETIO=`cat $COMMON_SITE_CONFIG_JSON | awk '/redis_socketio/ { gsub(/[",]/,"",$2); print $2}' | tr -d '\n' | sed 's|redis://||g'` echo "Check $DB_HOST:$DB_PORT" wait-for-it $DB_HOST:$DB_PORT -t 1