diff --git a/.drone.yml b/.drone.yml index eec79f2..90c8f52 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,39 +2,60 @@ kind: pipeline name: default steps: + # - name: docker-build + # image: plugins/docker + # settings: + # username: + # from_secret: DOCKER_USER + # password: + # from_secret: DOCKER_PASS + # repo: mhackspace-python + # dockerfile: ./compose/django/Dockerfile + # tags: latest + # repo: docker.digitaloctave.com/do-registry + # registry: docker.digitaloctave.com + - name: tests - image: python:3.6 + image: docker.digitaloctave.com/python-built:3.6-alpine environment: PYTHONUSERBASE: /drone/src/cache/packages POSTGRES_USER: mhackspace USE_DOCKER: yes DJANGO_SETTINGS_MODULE: config.settings.test - BUCKET_URL: http://minio:9000 commands: - - cp -n env.example .env + - apk add git build-base gcc python3-dev postgresql-dev musl-dev jpeg-dev zlib-dev openjpeg-dev tiff-dev libffi-dev freetype-dev libev-dev lcms2-dev tk-dev tcl-dev harfbuzz-dev fribidi-dev libxslt-dev + - cp env.example .env - mkdir -p ./cache/packages ./cache/pip - - pip install --user --cache-dir ./cache/pip -r ./requirements/test.txt + - pip install -r ./requirements/test.txt - python manage.py compilescss - python manage.py collectstatic --no-input - pytest -v # - python manage.py test mhackspace --keepdb --verbosity 2 + + - name: publish-stage pull: True image: appleboy/drone-ssh - host: stage.maidstone-hackspace.org.uk - user: root - secrets: [ ssh_key ] - port: 22 - command_timeout: 480 - script: - - cd /var/www/maidstone-hackspace-website - - git pull - - docker-compose -fstage.yml build - - docker-compose -fstage.yml run --rm django python manage.py compilescss - - docker-compose -fstage.yml run --rm django python manage.py collectstatic - - docker-compose -fstage.yml down --remove-orphans - - docker-compose -fstage.yml up -d + settings: + host: stage.maidstone-hackspace.org.uk + username: + from_secret: ssh_user + key: + from_secret: ssh_key + port: 22 + duration: 4m + + command_timeout: 480 + script: + - cd /var/www/maidstone-hackspace-website + - git pull + - docker-compose -fstage.yml build + - docker-compose -fstage.yml run --rm django python manage.py compilescss + - docker-compose -fstage.yml run --rm django python manage.py collectstatic + - docker-compose -fstage.yml down --remove-orphans + - docker-compose -fstage.yml up -d + - echo 'Finished deploy' - name: publish-live pull: True @@ -61,7 +82,7 @@ services: - npm --version - npm install - - name: minio + - name: bucket image: minio/minio environment: MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE diff --git a/compose/django/Dockerfile b/compose/django/Dockerfile index 7bc1c20..1a04132 100644 --- a/compose/django/Dockerfile +++ b/compose/django/Dockerfile @@ -10,7 +10,7 @@ RUN apk add --no-cache git build-base gcc \ COPY ./requirements /requirements -RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt \ +RUN pip install --no-cache-dir -r /requirements/local.txt \ && addgroup -g 1000 -S django \ && adduser -u 1000 -S django -G django diff --git a/compose/django/Dockerfile-dev b/compose/django/Dockerfile-dev index 7bc1c20..1a04132 100644 --- a/compose/django/Dockerfile-dev +++ b/compose/django/Dockerfile-dev @@ -10,7 +10,7 @@ RUN apk add --no-cache git build-base gcc \ COPY ./requirements /requirements -RUN pip install --cache-dir ./cache/pip -r /requirements/local.txt \ +RUN pip install --no-cache-dir -r /requirements/local.txt \ && addgroup -g 1000 -S django \ && adduser -u 1000 -S django -G django diff --git a/requirements/base.txt b/requirements/base.txt index e06ed59..4678703 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -2,16 +2,16 @@ # like Pillow and psycopg2 # See http://bitly.com/wheel-building-fails-CPython-35 # Verified bug on Python 3.5.1 -wheel==0.32.3 +wheel==0.33.1 # Bleeding edge Django -django==2.1.7 +django==2.2.1 django-dynamic-filenames==1.1.4 # Configuration django-environ==0.4.5 whitenoise==4.1.2 # Static and Media Storage # ------------------------------------------------ -boto3==1.9.96 +boto3==1.9.142 django-storages==1.7.1 # django-storages-redux==1.3.2 @@ -20,29 +20,29 @@ django-storages==1.7.1 django-braces==1.13.0 django-crispy-forms==1.7.2 -django-extensions==2.1.5 -Werkzeug==0.14.1 +django-extensions==2.1.6 +Werkzeug==0.15.2 # Models django-stdimage==4.0.1 django-model-utils==3.1.2 # Images -Pillow==5.4.1 +Pillow==6.0.0 # For user registration, either via email or social # Well-built with regular release cycles! -django-allauth==0.38.0 +django-allauth==0.39.1 # Python-PostgreSQL Database Adapter -psycopg2==2.7.7 +psycopg2==2.8.2 # Unicode slugification awesome-slugify==1.6.5 # Time zones support -pytz==2018.9 +pytz==2019.1 # Redis support django-redis==4.10.0 @@ -54,45 +54,45 @@ django-compressor==2.2 #fix for use with s3 buckets merged in master, so next release we can remove this #django-sass-processor==0.5.7 git+https://github.com/jrief/django-sass-processor.git -libsass==0.17.0 -lxml==4.3.1 +libsass==0.18.0 +lxml==4.3.3 # WSGI Handler # ------------------------------------------------ gevent==1.4.0 gunicorn==19.9.0 #https://github.com/jonashaag/bjoern -bjoern +bjoern==2.2.3 # Your custom requirements go here -mock==2.0.0 +mock==3.0.4 gocardless_pro==1.9.0 -braintree==3.51.0 +braintree==3.53.0 django-autofixture==0.12.1 wiki==0.4.4 -djangorestframework==3.9.1 +djangorestframework==3.9.3 djangorestframework-jwt==1.11.0 django-filter==2.1.0 coreapi==2.3.3 # api libraries end -martor==1.3.8 +martor==1.4.0 -django-spirit==0.7.0 -django-djconfig==0.9.0 +django-spirit==0.7.1 +django-djconfig==0.10.0 django-haystack==2.8.1 django-xforwardedfor-middleware==2.0 # Application queue -huey[backends] +huey[backends]==2.0.1 argon2-cffi==19.1.0 -django-cors-headers==2.4.0 +django-cors-headers==2.5.3 python-magic==0.4.15 -ldap3==2.5.2 +ldap3==2.6 bcrypt==3.1.6 python-twitter==3.5 feedparser==5.2.1 diff --git a/requirements/test.txt b/requirements/test.txt index c8c5c8a..709a256 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,15 +2,15 @@ -r base.txt # linting -flake8==3.7.5 # pyup: != 2.6.0 +flake8==3.7.7 # pyup: != 2.6.0 -coverage==4.5.2 +coverage==4.5.3 factory-boy==2.11.1 django-coverage-plugin==1.6.0 django-test-plus==1.1.1 -# pytest -pytest-django==3.4.7 +pytest==4.4.1 +pytest-django==3.4.8 pytest-sugar==0.9.2 model_mommy==1.6.0