From aa1a4dbc726772480ca36617e994924a7ee434fd Mon Sep 17 00:00:00 2001 From: heinzel Date: Fri, 12 Apr 2019 23:02:55 +0200 Subject: [PATCH] UPD: copy django-test repository from outside instead of git clone from inside. --- .gitignore | 1 + Dockerfile | 5 ++-- README | 3 +++ .../usr/local/bin/install-django-test.sh | 23 +++++++++++++------ 4 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 .gitignore create mode 100644 README diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..84bad3b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +django-test diff --git a/Dockerfile b/Dockerfile index 685a83d..9a311fe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 ["--"] - diff --git a/README b/README new file mode 100644 index 0000000..0e4123f --- /dev/null +++ b/README @@ -0,0 +1,3 @@ +git clone https://heinzelwelt.de/vcs/python/django-test +make image +make test-run diff --git a/container-files/usr/local/bin/install-django-test.sh b/container-files/usr/local/bin/install-django-test.sh index 6877c17..b214d2b 100755 --- a/container-files/usr/local/bin/install-django-test.sh +++ b/container-files/usr/local/bin/install-django-test.sh @@ -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 <> "${DJANGO_PATH}/main/settings.py" ALLOWED_HOSTS = ['*'] DEBUG = True E-O-H + +### end ###