Commit db3f307b authored by Joost Rijneveld's avatar Joost Rijneveld
Browse files

Merge branch 'templatecheck_only_when_installed' into 'master'

Only set up templatecheck if installed

See merge request !734
parents ad685ca1 fe69674c
......@@ -2,6 +2,9 @@ FROM python:3.5
MAINTAINER Thom Wiggers <thom@thomwiggers.nl>
LABEL description="Contains the Thaliawebsite Django application"
# Arguments
ARG install_dev_requirements=1
# Try to keep static operation on top to maximise Docker cache utilisation
# Disable output buffering
......@@ -41,9 +44,13 @@ COPY docs/requirements.txt /usr/src/app/docs/
RUN pip install --no-cache-dir \
-r requirements.txt \
-r production-requirements.txt \
-r dev-requirements.txt \
-r ../docs/requirements.txt
RUN if [ "$install_dev_requirements" -eq 1 ]; then \
pip install --no-cache-dir -r dev-requirements.txt; \
fi
# Create entry points
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY resources/entrypoint_production.sh /usr/local/bin/entrypoint_production.sh
......@@ -59,3 +66,5 @@ COPY docs /usr/src/app/docs
# Cache docs between builds if not mounting to FS
VOLUME /concrexit/docs
RUN echo "Don't build releases without release.sh!"
......@@ -72,7 +72,7 @@ fi
docker_tag="registry.gitlab.com/thaliawww/concrexit:$version"
docker build --pull -t "$docker_tag" .
docker build --build-arg install_dev_requirements=0 --pull -t "$docker_tag" .
if yesno "Do you want to push the container?"; then
docker push "$docker_tag"
......
......@@ -4,7 +4,6 @@ Pillow>=5.0,<5.1
django-compressor>=2.1,<3
django-sendfile<=0.4
freezegun>=0.3.9,<0.4.0
django-template-check>=0.3.0 # This should be in dev-requirements somehow
bleach>=2.1.0,<2.2
django-tinymce4-lite>=1.7,<1.8
rcssmin>=1.0.6
......
......@@ -10,7 +10,7 @@ commands =
; specified below
cp {toxinidir}/requirements.txt {envbindir}/reqtemp.txt
sed -i /Django>=.*/d {envbindir}/reqtemp.txt
pip install -r{envbindir}/reqtemp.txt
pip install -r{envbindir}/reqtemp.txt -r{toxinidir}/dev-requirements.txt
pipconflictchecker # if this fails, use pipdeptree to debug
python manage.py check
python manage.py templatecheck --project-only
......
......@@ -17,7 +17,6 @@ from django.utils.log import DEFAULT_LOGGING
from . import settings
INSTALLED_APPS = settings.INSTALLED_APPS
INSTALLED_APPS.remove('django_template_check')
INSTALLED_APPS.append('django_slack')
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
......
......@@ -50,7 +50,6 @@ INSTALLED_APPS = [
'django.contrib.sitemaps',
# Dependencies
'tinymce',
'django_template_check', # This is only necessary in development
'rest_framework',
'rest_framework.authtoken',
'compressor',
......@@ -78,6 +77,15 @@ INSTALLED_APPS = [
'payments.apps.PaymentsConfig',
]
# enable template check if it's installed
# this allows us to not have it enabled in production
try:
import django_template_check
del django_template_check
INSTALLED_APPS.append('django_template_check')
except ImportError:
pass
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment