Skip to content

Commit

Permalink
Closed #83 - The initial data files have been changed. now table meta…
Browse files Browse the repository at this point in the history
…data is not imported using django loaddata.
  • Loading branch information
glaubervila committed Jun 21, 2024
1 parent 2843756 commit 2f9d9f3
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 8,412 deletions.
46 changes: 40 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ A saida do comando informa se todos os serviços foram iniciados corretamente.

Os Comandos a seguir são executados **com todos os serviços ligados**.

Load Initial Data

```bash
docker compose exec daiquiri python manage.py loaddata /app/fixtures/initial_data.json
```

```bash
docker compose exec daiquiri python manage.py loaddata /app/fixtures/query_samples.json
```

Estes comandos são expecificos do Daiquiri:
[Setup groups](https://django-daiquiri.github.io/docs/administration/)

Expand All @@ -145,12 +155,6 @@ docker compose exec daiquiri python manage.py setup_groups
docker compose exec daiquiri python manage.py setup_tap_metadata
```

Load Initial Data

```bash
docker compose exec daiquiri python manage.py loaddata /app/fixtures/initial_data.json
```

Crie um usuario administrativo no Django.

```bash
Expand Down Expand Up @@ -216,6 +220,31 @@ docker compose exec daiquiri python manage.py loaddata /app/fixtures/query_sampl

https://www.accordbox.com/blog/how-export-restore-wagtail-site/

```bash
docker compose exec daiquiri python manage.py dumpdata --natural-foreign --indent 2 \
-e contenttypes \
-e auth.permission \
-e auth.group \
-e admin.logentry \
-e sessions \
-e daiquiri_auth \
-e daiquiri_conesearch \
-e daiquiri_contact \
-e daiquiri_datalink \
-e daiquiri_files \
-e daiquiri_jobs \
-e daiquiri_metadata \
-e daiquiri_oai \
-e daiquiri_query \
-e daiquiri_registry \
-e daiquiri_serve \
-e daiquiri_stats \
-e daiquiri_tap \
-e wagtailcore.groupcollectionpermission \
-e wagtailcore.grouppagepermission -e wagtailimages.rendition \
> initial_data.json
```

```bash
docker compose exec daiquiri python manage.py dumpdata --natural-foreign --indent 2 \
-e contenttypes -e auth.permission \
Expand All @@ -224,6 +253,11 @@ docker compose exec daiquiri python manage.py dumpdata --natural-foreign --inde
-e sessions > initial_data.json
```






### Build Manual da Imagem docker

Estando logado no dockerhub pelo terminal execute o build e o push da imagem do daiquiri.
Expand Down
6 changes: 3 additions & 3 deletions compose/local/daiquiri/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ COPY ./attribute-maps /app/attribute-maps
COPY ./certificates /app/certificates
COPY ./metadatas /app/metadatas

# # Database Fixtures Initial Data
COPY --chmod=0765 ./database_sample/initial_data.json /app/fixtures/initial_data.json
COPY --chmod=0765 ./database_sample/query_samples.json /app/fixtures/query_samples.json
# # # Database Fixtures Initial Data
# COPY --chmod=0765 ./database_sample/initial_data.json /app/fixtures/initial_data.json
# COPY --chmod=0765 ./database_sample/query_samples.json /app/fixtures/query_samples.json

# Basic Settings necessary for run download_vendor_files during build process
# NÃO ALTERAR os paths utilizar os volumes no docker-compose para indicar os diretórios.
Expand Down
1 change: 0 additions & 1 deletion compose/local/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ services:
- ./certificates:/app/certificates
- ./metadatas:/app/metadatas
# Data folders
- ./database_sample:/app/fixtures
- ./data/files:/data/files
- ./data/download:/data/download
- ./data/upload:/data/upload
Expand Down
1 change: 0 additions & 1 deletion daiquiri/fixtures/.gitignore

This file was deleted.

Loading

0 comments on commit 2f9d9f3

Please sign in to comment.