From 9d4bbc622d34eb367ece87ffe7eb33a8d0d8163e Mon Sep 17 00:00:00 2001 From: Vince Forgione Date: Sun, 7 Jan 2024 05:00:14 +0000 Subject: [PATCH] updated readme with more info about dev --- .gitignore | 5 ++-- .tool-versions | 2 -- CHANGELOG.md | 2 +- CONTRIBUTORS.md | 1 + README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 80 insertions(+), 5 deletions(-) delete mode 100644 .tool-versions diff --git a/.gitignore b/.gitignore index 42b70ad..1f404da 100644 --- a/.gitignore +++ b/.gitignore @@ -23,5 +23,6 @@ erl_crash.dump pg_ranges-*.tar # other stuff -/.elixir_ls/ -/.vscode/ +.devcontainer +.elixir_ls +.vscode diff --git a/.tool-versions b/.tool-versions deleted file mode 100644 index 2b1e612..0000000 --- a/.tool-versions +++ /dev/null @@ -1,2 +0,0 @@ -erlang 23.2.4 -elixir 1.11.3-otp-23 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ff9cc7..5dcfead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # ChangeLog -## v1.x.x +## v1.1.1 - Updated configuration to use the `Config` module (@jcomellas) - Modified test supervisor child spec to use current scheme (@jcomellas) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 98f6124..a8deddb 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -5,3 +5,4 @@ Original Author: Major Code Contributors: - @rparcus +- @jcomellas diff --git a/README.md b/README.md index e6a7f48..8973db1 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,78 @@ def deps do ] end ``` + +## Dev Setup + +While trying to not be prescriptive about how to work on this package, I +recommend using [VSCode](https://code.visualstudio.com) with the +[Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) +and [ElixirLS](https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls) +extensions. The `.gitignore` file ignores `.devcontainer/` and `.vscode/` +directories, so feel free to use whatever you deem necessary. + +
+Basic Dev Container Setup + +**.devcontainer/Dockerfile**: + +```dockerfile +FROM elixir:1.16 +WORKDIR /workspace +``` + +**.devcontainer/docker-compose.yaml**: + +```yaml +version: '3' +services: + db: + image: postgres + restart: unless-stopped + environment: + - POSTGRES_USER=pgranges + - POSTGRES_PASSWORD=pgranges + code: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + command: sleep infinity + volumes: + - ..:/workspace:cached + depends_on: + - db +``` + +**.devcontainer/devcontainer.json**: + +```json +{ + "name": "pg_range", + "dockerComposeFile": "docker-compose.yaml", + "service": "code", + "workspaceFolder": "/workspace" +} +``` + +
+ +### Running the Tests + +
+Local Only (Not in a Dev Container) + +First, you'll need a locally running Postgres server. The easiest way to do this +is using Docker: + +```shell +$ docker pull postgres +$ docker run -p 5432:5432 -e POSTGRES_USER=pgranges -e POSTGRES_PASSWORD=pgranges postgres +``` + +
+ +To run the tests: + +```shell +$ mix test +```