Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fixtures to fill data in a local environment #303

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ The run the migration of the database with
make migrate-db
```

The load the fixtures with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The load the fixtures with
You can load some fixtures with


```sh
make load-fixtures
```

Congrats, you can now contribute to the codebase :tada:

## Run locally
Expand Down
7 changes: 7 additions & 0 deletions Makefile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ migrate-db:
add-db-revision: guard-message
${DOCKER_COMPOSE} run --rm --no-deps api alembic revision --autogenerate -m "${message}"


# load fixtures
load-fixtures:
@echo "🥫 Loading fixtures …"
${DOCKER_COMPOSE} run --rm --no-deps api poetry run python fixtures/import_data.py


#---------#
# Cleanup #
#---------#
Expand Down
2 changes: 2 additions & 0 deletions docker/dev.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ x-api-base: &api-base
# mount code dynamically
- "./app:/opt/open-prices/app"
- ./pyproject.toml:/opt/open-prices/pyproject.toml
# mount fixtures
- "./fixtures:/opt/open-prices/fixtures"
# make doc generation available
- ./mkdocs.yml:/opt/open-prices/mkdocs.yml
- ./build_mkdocs.sh:/opt/open-prices/build_mkdocs.sh
Expand Down
Empty file added fixtures/__init__.py
Empty file.
Loading