* 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
* Install foreman for procfile and setup appdomain for csrf in gitpod
Foreman was not installed (so bin/startup would fail fast).
Additionally, the APP_DOMAIN can be fetched from the `gp` utility to
get the url for port 3000
Since the .env file is read top down - it's easier to implement
appending the corrected value than to replace it at the beginning, but
I'm completely open to redoing this via a sed command or similar to
change the variable at the top (this would be less confusing for
anyone else dealing with the file).
* Ensure command executes as a series of commands
TODO: if this works move the echo commands into the setup section
* move .env setup commands to init section
The `.env` file shouldn't live in the `/config` directory when it is created, but
currently, the `.env_sample` file lives within `/config`. This can be confusing and
cause ENV var issues if someone duplicates `.env_sample` and renames it to `.env`,
because none of their ENV variables will get picked up, since their `.env` file will
mistakenly end up in `/config`.
This change moves `.env_sample` out of `/config`, and updates the documentation/relevant
.yml files accordingly.
* Refactor:Remove ENVied Gem in Favor of Default application.yml
* Copy sample_application.yml for Travis
* Create .env_sample file, Warn of missing ENV variables, ignore .env file
* Use dotenv For ENV variables and create Rake Task to Populate
* Update docs to copy .env_sample file
* make application config a bit more resilient
* update more documentation and only initialize dotenv in dev and test
* Update doc code snippet types and refactor rake task and app config
* remove push defaults
* Make initializers more resilient, remove unused ENV from travis
* Exit new rake task if application.yml does not exist, include dotenv in docs
This commit improves the Gitpod setup. It now allows you to benefit from prebuilds.
Also, Gitpod now waits until the server is ready before opening a preview window.
* Unset DATABASE_URL in .gitpod.yml
* Only run bin/setup once
* Try alternative approach for unsetting DATABASE_URL
* Update bin/setup
* Consistently use db_url
* Fix bug caused by typo (= instead of ==)