diff --git a/scripts/deploy-backend.sh b/scripts/deploy-backend.sh index 97df1a3bc..38823c39b 100755 --- a/scripts/deploy-backend.sh +++ b/scripts/deploy-backend.sh @@ -148,15 +148,15 @@ update_backend() check_app_health() { #check if the backend is up and running - cf_cmd="cf a | grep -q "$CGAPPNAME_BACKEND" | awk '{print $2}' | grep "started" | wc -l" - app_status=$cf_cmd + cf_cmd="cf a | grep \"$CGAPPNAME_BACKEND\" | grep -c \"started\"" + app_status=exec $cf_cmd #TODO: implement wait loop and then 10m timeout, need to catch perma-staging cf_logs_cmd="cf logs $CGAPPNAME_BACKEND --recent| grep -q 'Starting gunicorn' && echo $?" - log_status=$cf_logs_cmd + log_status=exec $cf_logs_cmd cf_traceback_cmd="cf logs $CGAPPNAME_BACKEND --recent | grep -q 'Traceback .most recent call last.:' && echo $?" - cf_traceback_count=$cf_traceback_cmd + cf_traceback_count=exec $cf_traceback_cmd if [ "$app_status" -eq 0 ] || [ $log_status -eq 1]; then echo "App $CGAPPNAME_BACKEND is not running. Exiting."