UPD: copy django-test repository from outside instead of git clone
from inside.
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
django-test
|
||||
@@ -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
3
README
Normal file
@@ -0,0 +1,3 @@
|
||||
git clone https://heinzelwelt.de/vcs/python/django-test
|
||||
make image
|
||||
make test-run
|
||||
@@ -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 ###
|
||||
|
||||
Reference in New Issue
Block a user