Skip to content

Commit 559ad4c

Browse files
committed
Add CONTRIBUTE.md and docker-compose file with databases setup
1 parent 8da65a9 commit 559ad4c

2 files changed

Lines changed: 51 additions & 0 deletions

File tree

CONTRIBUTE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Guidelines for contributing
2+
3+
## 1. Fork & Clone
4+
5+
Since you probably don't have rights to the main repo, you should Fork it (big
6+
button up top). After that, clone your fork locally and optionally add an
7+
upstream:
8+
9+
git remote add upstream git@github.com:DatabaseCleaner/database_cleaner-active_record.git
10+
11+
## 2. Make sure the tests run fine
12+
13+
The gem uses Appraisal to configure different Gemfiles to test different Rails versions.
14+
15+
- You can run all the databases through docker if needed with `docker compose up` (you can also have them running on your system, just comment out the ones you don't need from the `docker-compose.yml` file)
16+
- Copy `spec/support/sample.config.yml` to `spec/support/config.yml` and edit it
17+
- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle install` (change `6.1` with any version from the `gemfiles` directory)
18+
- `BUNDLE_GEMFILE=gemfiles/rails_6.1.gemfile bundle exec rake`
19+
20+
Note that if you don't have all the supported databases installed and running,
21+
some tests will fail.
22+
23+
> Note that you can check the `.github/workflows/ci.yml` file for different combinations of Ruby and Rails that are expected to work
24+
25+
## 3. Prepare your contribution
26+
27+
This is all up to you but a few points should be kept in mind:
28+
29+
- Please write tests for your contribution
30+
- Make sure that previous tests still pass
31+
- Push it to a branch of your fork
32+
- Submit a pull request

docker-compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
postgres:
3+
image: postgres:16 # specify the version needed for a given app
4+
environment:
5+
- POSTGRES_PASSWORD=postgres # this is required
6+
ports:
7+
- "127.0.0.1:5432:5432" # so we can use `localhost` as the host
8+
mysql:
9+
image: mysql:9.3
10+
environment:
11+
- MYSQL_ROOT_PASSWORD=mysql
12+
ports:
13+
- "127.0.0.1:3306:3306"
14+
redis:
15+
image: redis:6.2-alpine
16+
restart: always
17+
ports:
18+
- "127.0.0.1:6379:6379"
19+
command: redis-server --save 20 1 --loglevel warning

0 commit comments

Comments
 (0)