Skip to content

Commit

Permalink
feat: move to V2
Browse files Browse the repository at this point in the history
  • Loading branch information
Naramsim committed Mar 25, 2024
1 parent f0b5103 commit 5a44b4a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ graphql
.vscode
.github
.circleci
docker-compose.yml
docker-compose*
.dockerignore
/*.md
/*.js
Expand Down
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,38 @@ shell: # Load a shell
python manage.py shell ${local_config}

docker-up: # (Docker) Create services/volumes/networks
docker-compose up -d
docker compose up -d

docker-migrate: # (Docker) Run any pending migrations
docker-compose exec -T app python manage.py migrate ${docker_config}
docker compose exec -T app python manage.py migrate ${docker_config}

docker-build-db: # (Docker) Build the database
docker-compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}'
docker compose exec -T app sh -c 'echo "from data.v2.build import build_all; build_all()" | python manage.py shell ${docker_config}'

docker-make-migrations: # (Docker) Create migrations files if schema has changed
docker-compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}'
docker compose exec -T app sh -c 'python manage.py makemigrations ${docker_config}'

docker-flush-db: # (Docker) Removes all the data present in the database but preserves tables and migrations
docker-compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}'
docker compose exec -T app sh -c 'python manage.py flush --no-input ${docker_config}'

docker-destroy-db: # (Docker) Removes the volume where the database is installed on, alongside to the container itself
docker rm -f pokeapi_db_1
docker volume rm pokeapi_pg_data

docker-shell: # (Docker) Launch an interative shell for the pokeapi container
docker-compose exec app sh -l
docker compose exec app sh -l

docker-stop: # (Docker) Stop containers
docker-compose stop
docker compose stop

docker-down: # (Docker) Stop and removes containers and networks
docker-compose down
docker compose down

docker-test: # (Docker) Run tests
docker-compose exec -T app python manage.py test ${local_config}
docker compose exec -T app python manage.py test ${local_config}

docker-prod:
docker-compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d
docker compose -f docker-compose.yml -f docker-compose.override.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d

docker-setup: docker-up docker-migrate docker-build-db # (Docker) Start services, prepare the latest DB schema, populate the DB

Expand Down Expand Up @@ -148,4 +148,4 @@ update-graphql-data-prod:
docker compose exec -T web sh -c 'rm -rf /tmp/cache/*'
docker compose start graphql-engine
sleep 120
make hasura-apply
make hasura-apply
2 changes: 1 addition & 1 deletion docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ services:
context: .
dockerfile: ./Resources/docker/app/Dockerfile

# docker-compose -f docker-compose.yml -f docker-compose-dev.yml up -d
# docker compose -f docker-compose.yml -f docker-compose-dev.yml up -d

0 comments on commit 5a44b4a

Please sign in to comment.