From 7c540abc8d2f3913ece08da00e380458ba399f29 Mon Sep 17 00:00:00 2001 From: Daniel Uber Date: Fri, 19 Nov 2021 11:35:46 -0600 Subject: [PATCH] Gitpod: wait for postgresql to be listening before startup (#15429) * Wait for postgresql to be listening on port before setup and startup https://github.com/forem/forem/issues/15428 points out an issue where the command sequence runs (foreman starts the Procfile.dev) but rails exits early because the database is not up. Await the db port before proceeding. * Await database in gitpod before starting up * Move await-port to before: action see https://www.gitpod.io/docs/config-start-tasks - init is only run as needed (prebuild, new workspace) once, before is run every time a workspace starts or restarts. * When in doubt, sleep --- .gitpod.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitpod.yml b/.gitpod.yml index 1ea3f9bb1..8227cce68 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -13,7 +13,10 @@ ports: tasks: - name: Forem Server - before: redis-server & + before: > + redis-server & + gp await-port 5432 && + sleep 1 init: ./gitpod-init.sh command: bin/startup - name: Open Site