Skip to content

Commit

Permalink
run the management commands from the project dir
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Nov 2, 2023
1 parent fc6c486 commit 2ecb867
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/after_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ $VENV_DIR/bin/pip install -r $PROJECT_DIR/requirements.txt --upgrade

# OPTIONAL Run migrations and other management commands that should be run with
# every deployment
env $(cat $PROJECT_DIR/.env | xargs) $VENV_DIR/bin/python $PROJECT_DIR/manage.py migrate
env $(cat $PROJECT_DIR/.env | xargs) $VENV_DIR/bin/python $PROJECT_DIR/manage.py createcachetable
env $(cat $PROJECT_DIR/.env | xargs) $VENV_DIR/bin/python $PROJECT_DIR/manage.py collectstatic --no-input
env $(cat $PROJECT_DIR/.env | xargs) $VENV_DIR/bin/python $PROJECT_DIR/manage.py compress
(
cd $PROJECT_DIR
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py migrate
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py createcachetable
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py collectstatic --no-input
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py compress
)

# Set the ownership of the project files and the virtual environment
chown -R datamade.www-data $PROJECT_DIR
Expand Down

0 comments on commit 2ecb867

Please sign in to comment.