mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 09:26:08 -05:00
Merge pull request #1491 from alphagov/error-on-app-crash
if apps crash on startup, then fail deploy process
This commit is contained in:
3
Makefile
3
Makefile
@@ -281,6 +281,9 @@ cf-deploy: ## Deploys the app to Cloud Foundry
|
|||||||
# sleep for 10 seconds to try and make sure that all worker threads (either web api or celery) have finished before we delete
|
# sleep for 10 seconds to try and make sure that all worker threads (either web api or celery) have finished before we delete
|
||||||
# when we delete the DB is unbound from the app, which can cause "permission denied for relation" psycopg2 errors.
|
# when we delete the DB is unbound from the app, which can cause "permission denied for relation" psycopg2 errors.
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
||||||
|
# get the new GUID, and find all crash events for that. If there were any crashes we will abort the deploy.
|
||||||
|
[ $(cf curl "/v2/events?q=type:app.crash&q=actee:$$(cf app --guid notify-delivery-worker-receipts)" | jq ".total_results") -eq 0 ]
|
||||||
cf delete -f ${CF_APP}-rollback
|
cf delete -f ${CF_APP}-rollback
|
||||||
|
|
||||||
.PHONY: cf-deploy-api-db-migration
|
.PHONY: cf-deploy-api-db-migration
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ function on_exit {
|
|||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "Application process terminated, waiting 10 seconds"
|
|
||||||
sleep 10
|
|
||||||
echo "Terminating remaining subprocesses.."
|
echo "Terminating remaining subprocesses.."
|
||||||
kill 0
|
kill 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user