Skip to content

Commit

Permalink
updated readme with more info about dev
Browse files Browse the repository at this point in the history
  • Loading branch information
vforgione committed Jan 7, 2024
1 parent 24197a4 commit 9d4bbc6
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ erl_crash.dump
pg_ranges-*.tar

# other stuff
/.elixir_ls/
/.vscode/
.devcontainer
.elixir_ls
.vscode
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Original Author:

Major Code Contributors:
- @rparcus
- @jcomellas
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<details>
<summary>Basic Dev Container Setup</summary>

**.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"
}
```

</details>

### Running the Tests

<details>
<summary>Local Only (Not in a Dev Container)</summary>

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

</details>

To run the tests:

```shell
$ mix test
```

0 comments on commit 9d4bbc6

Please sign in to comment.