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
This commit is contained in:
Daniel Uber 2021-11-19 11:35:46 -06:00 committed by GitHub
parent 9687760056
commit 7c540abc8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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