Skip to content

Commit

Permalink
ci/cd: wait for db
Browse files Browse the repository at this point in the history
  • Loading branch information
chandansgowda committed Aug 20, 2023
1 parent 607b4d1 commit bd77da7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
- name: Unit Testing
run: docker-compose run --rm app sh -c "python manage.py test"
run: docker-compose run --rm app sh -c "python manage.py wait_for_db && python manage.py test"
- name: Linting
run: docker-compose run --rm app sh -c "flake8"

4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ services:
volumes:
- ./app:/app
command: >
sh -c "python manage.py runserver 0.0.0.0:8000"
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
environment:
- DB_HOST=db
- DB_NAME=devdb
Expand Down

0 comments on commit bd77da7

Please sign in to comment.