Skip to content

Commit

Permalink
Seed DEV v4 db
Browse files Browse the repository at this point in the history
relates to #380
  • Loading branch information
minottic committed Nov 26, 2024
1 parent 17d3e88 commit 72102fa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/backend/services/v4/config/.dev.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MONGODB_URI=mongodb://mongodb:27017/dev_be_next
MONGODB_URI=mongodb://mongodb:27017/dev-dacat-next
ADMIN_GROUPS=admin,adminingestor
CREATE_DATASET_GROUPS=group1,group2,group3
CREATE_DATASET_WITH_PID_GROUPS=group2
Expand Down
2 changes: 2 additions & 0 deletions services/mongodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ These files are ingested into the database using mongo funcionalities and bypass

In the default configuration [init.sh](./config/init.sh), the seeding creates data in the mongodb database used by the `backend` service (either [v4](../backend/services/v4/), by default, or [v3](../backend/services/v3/) if specified otherwise by setting `BE_VERSION`).

When `DEV=true` and `BE_VERSION=v4` the seeding writes to `dev-dacat-next`.

For an explanation of how setting `BE_VERSION` changes the environment creation see [here](../../README.md#docker-compose-profiles-and-env-variables-configuration-options).

## Dependency on `BE_VERSION`
Expand Down
1 change: 1 addition & 0 deletions services/mongodb/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- ./config/seed:/seed
environment:
BE_VERSION: ${BE_VERSION:-v4}
DEV: ${DEV:+dev-}
restart: on-failure

volumes:
Expand Down
2 changes: 1 addition & 1 deletion services/mongodb/config/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cd /seed || exit

[ "${BE_VERSION}" = "v4" ] && DB="dacat-next" || DB="dacat"
[ "${BE_VERSION}" = "v4" ] && DB="${DEV}dacat-next" || DB="dacat"

for FILE_NAME in *.json
do
Expand Down

0 comments on commit 72102fa

Please sign in to comment.