diff --git a/.drone.yml b/.drone.yml index 9e0aa96..ec85323 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,8 +27,9 @@ pipeline: script: - cd /var/www/stage/maidstone-hackspace-website - git pull - - docker-compose down - - docker-compose up -d + - docker-compose -fstage.yml build + - docker-compose -fstage.yml down --remove-orphans + - docker-compose -fstage.yml up -d publish-live: # pull: True diff --git a/compose/django/Dockerfile b/compose/django/Dockerfile index 6d9fde2..a3d19d2 100644 --- a/compose/django/Dockerfile +++ b/compose/django/Dockerfile @@ -5,7 +5,7 @@ ENV PYTHONUNBUFFERED 1 # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements -RUN pip install -r /requirements/production.txt \ +RUN pip install --cache-dir ./cache/pip -r /requirements/production.txt \ && groupadd -r django \ && useradd -r -g django django @@ -18,7 +18,7 @@ RUN mkdir -p /var/log/gunicorn/ \ && chmod -R 770 /var/log/gunicorn/ COPY ./compose/django/live-gunicorn-mhackspace.sh /live-gunicorn-mhackspace.sh -COPY ./compose/django/live-gunicorn-mhackspace.sh /stage-gunicorn-mhackspace.sh +COPY ./compose/django/stage-gunicorn-mhackspace.sh /stage-gunicorn-mhackspace.sh COPY ./compose/django/entrypoint.sh /entrypoint.sh RUN sed -i 's/\r//' /entrypoint.sh \ && sed -i 's/\r//' /stage-gunicorn-mhackspace.sh \ diff --git a/compose/django/Dockerfile-dev b/compose/django/Dockerfile-dev index 77373f2..70b4eba 100644 --- a/compose/django/Dockerfile-dev +++ b/compose/django/Dockerfile-dev @@ -4,7 +4,7 @@ ENV PYTHONUNBUFFERED 1 # Requirements have to be pulled and installed here, otherwise caching won't work COPY ./requirements /requirements -RUN pip install -r /requirements/local.txt +RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt COPY ./compose/django/entrypoint.sh /entrypoint.sh RUN sed -i 's/\r//' /entrypoint.sh diff --git a/compose/django/stage-gunicorn-mhackspace.sh b/compose/django/stage-gunicorn-mhackspace.sh index d59987e..eae63f3 100644 --- a/compose/django/stage-gunicorn-mhackspace.sh +++ b/compose/django/stage-gunicorn-mhackspace.sh @@ -2,4 +2,4 @@ python /app/manage.py collectstatic --noinput python /app/manage.py compilescss -/usr/local/bin/gunicorn config.wsgi -w 4 -b unix:/data/sockets/stage-gunicorn-mhackpace.sock --error-logfile /var/log/gunicorn/stage-gunicorn-mhackspace.log --chdir=/app +/usr/local/bin/gunicorn config.wsgi -w 4 -b unix:/data/sockets/stage-gunicorn-mhackspace.sock --error-logfile /var/log/gunicorn/stage-gunicorn-mhackspace.log --chdir=/app diff --git a/mhackspace/base/migrations/0003_auto_20170215_2146.py b/mhackspace/base/migrations/0003_auto_20170215_2146.py index 88e0fc3..3ade02c 100644 --- a/mhackspace/base/migrations/0003_auto_20170215_2146.py +++ b/mhackspace/base/migrations/0003_auto_20170215_2146.py @@ -16,7 +16,7 @@ class Migration(migrations.Migration): operations = [ migrations.AlterField( - model_name='bannerimages', + model_name='bannerimage', name='scaled_image', field=stdimage.models.StdImageField(blank=True, null=True, upload_to=stdimage.utils.UploadToAutoSlugClassNameDir('title'), validators=[stdimage.validators.MinSizeValidator(1200, 300)]), ), diff --git a/mhackspace/base/migrations/0004_merge_20170226_0844.py b/mhackspace/base/migrations/0004_merge_20170226_0844.py new file mode 100644 index 0000000..4a2a7da --- /dev/null +++ b/mhackspace/base/migrations/0004_merge_20170226_0844.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-26 08:44 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('base', '0003_auto_20170215_2146'), + ('base', '0003_auto_20170222_2055'), + ] + + operations = [ + ] diff --git a/mhackspace/users/migrations/0003_merge_20170226_0844.py b/mhackspace/users/migrations/0003_merge_20170226_0844.py new file mode 100644 index 0000000..fd2dcb0 --- /dev/null +++ b/mhackspace/users/migrations/0003_merge_20170226_0844.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-26 08:44 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0002_auto_20170222_2055'), + ('users', '0002_user_public'), + ] + + operations = [ + ] diff --git a/requirements/base.txt b/requirements/base.txt index 6a08e6c..c2784ec 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -58,5 +58,7 @@ braintree==3.35.0 django-autofixture==0.12.1 git+https://github.com/olymk2/scaffold.git + djangorestframework==3.5.4 -django-filter +django-filter==1.0.1 + diff --git a/requirements/local.txt b/requirements/local.txt index 3b0db77..ae09f59 100644 --- a/requirements/local.txt +++ b/requirements/local.txt @@ -2,7 +2,7 @@ -r base.txt coverage==4.3.1 django-coverage-plugin==1.5.0 -Sphinx==1.5.1 +Sphinx==1.5.3 django-extensions==1.7.7 Werkzeug==0.11.15 django-test-plus==1.0.16