human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

Add Codespaces support

Open aeisenberg opened this issue 1 year ago • 3 comments

Resolves #3829

Description

This PR adds support for GitHub Codespaces. It includes a devcontainer configuration that will be used to create a Codespace for this repository. The configuration includes:

  • Dockerfile: Installs ruby:dev-3.2-buster image. When the version of ruby used by this project changes, the Dockerfile should be updated. An attempt to install the correct version of ruby will be done, but it will take a while to download and compile the version.
  • devcontainer.json: Specifies the configuration for the Codespace. It includes the Dockerfile to use, the extensions to install, and the settings to use.
  • docker-compose.yml: Specifies the services to run in the Codespace. It includes the postgres service.
  • post-create.sh: Script that runs after the Codespace is created. It optionally installs a new version of ruby, sets up the database, and prepares the environment.

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update
  • Documentation update

This PR adds codespaces support. It is not an externally facing feature. The documentation changes are only for setting up the dev environment. I have included a change to the README to help with this.

How Has This Been Tested?

To test this out, create a new codespace for the project, wait for everything to load, and run bin/start. The project should start with no errors.

aeisenberg avatar Apr 21 '24 05:04 aeisenberg

@dorner does this change make sense to you? Now if the .env already exists, the codespace version will not be copied over.

aeisenberg avatar May 07 '24 05:05 aeisenberg

Looks good to me - @awwaiid can you review?

dorner avatar May 10 '24 00:05 dorner

Ah -- also from testing you need to add config.hosts << ".app.github.dev" to config/environments/development.rb

image

awwaiid avatar May 10 '24 19:05 awwaiid

Closing in favour of https://github.com/rubyforgood/human-essentials/pull/4353.

aeisenberg avatar May 15 '24 01:05 aeisenberg