UPD: copy django-test repository from outside instead of git clone

from inside.
This commit is contained in:
2019-04-12 23:02:55 +02:00
parent 9c1338c0c2
commit aa1a4dbc72
4 changed files with 22 additions and 10 deletions

View File

@@ -1,19 +1,26 @@
#!/bin/sh
DJANGO_PROJECT_NAME="django-test"
PROJECT_REPO_URL="git+https://heinzelwelt.de/vcs/python/django-test"
### config ###
PROJECT_NAME="django-test"
PROJECT_REPO="git+https://heinzelwelt.de/vcs/python/django-test"
BASE_DIR="/var/www/wsgi/${DJANGO_PROJECT_NAME}"
INSTALL_DIR="/var/www/wsgi/${PROJECT_NAME}"
VENV_DIR="python"
VENV_PATH="${BASE_DIR}/${VENV_DIR}"
VENV_PATH="${INSTALL_DIR}/${VENV_DIR}"
DJANGO_DIR="django"
DJANGO_PATH="${BASE_DIR}/${DJANGO_DIR}"
DJANGO_PATH="${INSTALL_DIR}/${DJANGO_DIR}"
mkdir -p "$BASE_DIR"
### argv ###
if test "$1" != "" -a -d "$1" ; then
PROJECT_REPO="$1"
fi
### action ###
mkdir -p "$INSTALL_DIR"
python3 -m venv "${VENV_PATH}"
source "${VENV_PATH}/bin/activate"
pip install --upgrade pip
pip install "$PROJECT_REPO_URL"
pip install "$PROJECT_REPO"
django-test-admin setup "${DJANGO_PATH}"
python3 "${DJANGO_PATH}/manage.py" collectstatic --noinput
@@ -22,3 +29,5 @@ cat <<E-O-H >> "${DJANGO_PATH}/main/settings.py"
ALLOWED_HOSTS = ['*']
DEBUG = True
E-O-H
### end ###