(ops) Install pobsync-manage for native management commands
Add a pobsync-manage wrapper that loads the native environment file before running Django management commands, so production commands use the same database and runtime settings as the systemd services. Install the wrapper from the systemd installer, use it for migrations, static collection, SSH key setup, and superuser creation, and document it in the README for operational commands.
This commit is contained in:
19
deploy/bin/pobsync-manage
Normal file
19
deploy/bin/pobsync-manage
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
APP_DIR="@POBSYNC_APP_DIR@"
|
||||
VENV_DIR="@POBSYNC_VENV_DIR@"
|
||||
ENV_FILE="@POBSYNC_ENV_FILE@"
|
||||
|
||||
if [ ! -f "$ENV_FILE" ]; then
|
||||
echo "pobsync environment file not found: $ENV_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -a
|
||||
# shellcheck disable=SC1090
|
||||
. "$ENV_FILE"
|
||||
set +a
|
||||
|
||||
cd "$APP_DIR"
|
||||
exec "$VENV_DIR/bin/python" "$APP_DIR/manage.py" "$@"
|
||||
Reference in New Issue
Block a user