Skip to content

Commit

Permalink
bash syntax update
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-jameson committed Jul 23, 2024
1 parent 7f6bf43 commit 40a563f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/deploy-backend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down

0 comments on commit 40a563f

Please sign in to comment.