Skip to content

Commit

Permalink
Add manage script to tna-python-django
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Dec 16, 2024
1 parent 8bdc621 commit c8bbaca
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added `stylelint-order` for `stylelint`
- `manage` command added to `tna-python-django`

### Changed

Expand Down
4 changes: 2 additions & 2 deletions docker/tna-python-django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN set -eux; \
# in the parent Docker image, but with extra
# Django-specific commands
# ==========================================
COPY --chown=app bin/tna-build bin/tna-run /home/app/.local/bin/
COPY --chown=app bin/tna-build bin/tna-run bin/manage /home/app/.local/bin/

# ==========================================
# manage.py is the recommended Django way of
Expand All @@ -43,4 +43,4 @@ COPY --chown=app lib/manage.py /app
# ==========================================
# Allow all our scripts to be executable
# ==========================================
RUN chmod +x /home/app/.local/bin/tna-build /home/app/.local/bin/tna-run manage.py
RUN chmod +x /home/app/.local/bin/tna-build /home/app/.local/bin/tna-run /home/app/.local/bin/manage manage.py
14 changes: 14 additions & 0 deletions docker/tna-python-django/bin/manage
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

if [ -z "$1" ]
then
echo -e "Error: manage command not specified\n";
echo "PARAMETERS"
echo " command the manage.py script you want to run"
echo " Example: manage makemigrations";
exit 1
fi

poetry run python /app/manage.py "$1"

0 comments on commit c8bbaca

Please sign in to comment.