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

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
django-test

View File

@@ -3,15 +3,14 @@ FROM fedora
RUN dnf -y update && \
dnf -y install httpd && \
dnf -y install python3-mod_wsgi && \
dnf -y install git && \
dnf clean all
COPY container-files/ /
RUN /usr/local/bin/install-django-test.sh
COPY django-test /usr/local/share/django-test
RUN /usr/local/bin/install-django-test.sh /usr/local/share/django-test
EXPOSE 80
ENTRYPOINT ["/usr/local/sbin/start-httpd.sh"]
CMD ["--"]

3
README Normal file
View File

@@ -0,0 +1,3 @@
git clone https://heinzelwelt.de/vcs/python/django-test
make image
make test-run

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 ###