From 90bba7cc0d0cce4a5042317db6005d1144401db8 Mon Sep 17 00:00:00 2001 From: Forest Gregg Date: Tue, 31 Oct 2023 16:50:32 -0400 Subject: [PATCH] get access to env variables in after_install --- scripts/after_install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/after_install.sh b/scripts/after_install.sh index ad23846..c8b2f04 100644 --- a/scripts/after_install.sh +++ b/scripts/after_install.sh @@ -38,9 +38,9 @@ sudo -H -u datamade $VENV_DIR/bin/pip install -r $PROJECT_DIR/requirements.txt - # OPTIONAL Run migrations and other management commands that should be run with # every deployment -sudo -H -u datamade bash "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py migrate" -sudo -H -u datamade bash "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py createcachetable" -sudo -H -u datamade bash "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py collectstatic --no-input" +sudo -H -u datamade bash -c "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py migrate" +sudo -H -u datamade bash -c "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py createcachetable" +sudo -H -u datamade bash -c "source $PROJECT_DIR/.env && $VENV_DIR/bin/python $PROJECT_DIR/manage.py collectstatic --no-input" # Echo a simple nginx configuration into the correct place, and tell # certbot to request a cert if one does not already exist.