Compare commits

...

1 Commits

Author SHA1 Message Date
Oliver Marks 592bff85ca Turn of cache dir to save memory.
continuous-integration/drone/push Build is passing Details
2019-05-05 14:17:20 +01:00
7 changed files with 70 additions and 50 deletions

View File

@ -2,39 +2,59 @@ kind: pipeline
name: default name: default
steps: 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 - name: tests
image: python:3.6 image: olymk2/python-built:3.6-alpine
environment: environment:
PYTHONUSERBASE: /drone/src/cache/packages PYTHONUSERBASE: /drone/src/cache/packages
POSTGRES_USER: mhackspace POSTGRES_USER: mhackspace
USE_DOCKER: yes USE_DOCKER: yes
DJANGO_SETTINGS_MODULE: config.settings.test DJANGO_SETTINGS_MODULE: config.settings.test
BUCKET_URL: http://minio:9000
commands: 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 - 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 compilescss
- python manage.py collectstatic --no-input - python manage.py collectstatic --no-input
- pytest -v - pytest -v
# - python manage.py test mhackspace --keepdb --verbosity 2 # - python manage.py test mhackspace --keepdb --verbosity 2
- name: publish-stage - name: publish-stage
pull: True pull: True
image: appleboy/drone-ssh image: appleboy/drone-ssh
host: stage.maidstone-hackspace.org.uk settings:
user: root host: stage.maidstone-hackspace.org.uk
secrets: [ ssh_key ]
port: 22 username:
command_timeout: 480 from_secret: ssh_user
script: key:
- cd /var/www/maidstone-hackspace-website from_secret: ssh_key
- git pull port: 22
- docker-compose -fstage.yml build command_timeout: 30m
- docker-compose -fstage.yml run --rm django python manage.py compilescss script:
- docker-compose -fstage.yml run --rm django python manage.py collectstatic - cd /var/www/maidstone-hackspace-website
- docker-compose -fstage.yml down --remove-orphans - git pull
- docker-compose -fstage.yml up -d - 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 - name: publish-live
pull: True pull: True
@ -45,7 +65,7 @@ steps:
target: ssh_key target: ssh_key
host: maidstone-hackspace.org.uk host: maidstone-hackspace.org.uk
port: 22 port: 22
command_timeout: 480 command_timeout: 5m
script: script:
- echo 'to be added' - echo 'to be added'
when: when:
@ -61,7 +81,7 @@ services:
- npm --version - npm --version
- npm install - npm install
- name: minio - name: bucket
image: minio/minio image: minio/minio
environment: environment:
MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE MINIO_ACCESS_KEY: AKIAIOSFODNN7EXAMPLE

View File

@ -1,4 +1,4 @@
FROM python:3.6-alpine FROM olymk2/python-built:3.6-alpine
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
@ -10,7 +10,7 @@ RUN apk add --no-cache git build-base gcc \
COPY ./requirements /requirements 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 \ && addgroup -g 1000 -S django \
&& adduser -u 1000 -S django -G django && adduser -u 1000 -S django -G django

View File

@ -1,4 +1,4 @@
FROM python:3.6-alpine FROM olymk2/python-built:3.6-alpine
ENV PYTHONUNBUFFERED 1 ENV PYTHONUNBUFFERED 1
@ -10,7 +10,7 @@ RUN apk add --no-cache git build-base gcc \
COPY ./requirements /requirements 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 \ && addgroup -g 1000 -S django \
&& adduser -u 1000 -S django -G django && adduser -u 1000 -S django -G django

View File

@ -39,7 +39,7 @@ services:
huey: huey:
build: build:
context: . context: .
dockerfile: ./compose/django/Dockerfile-dev dockerfile: ./compose/django/Dockerfile
user: django user: django
depends_on: depends_on:
- postgres - postgres

View File

@ -2,16 +2,16 @@
# like Pillow and psycopg2 # like Pillow and psycopg2
# See http://bitly.com/wheel-building-fails-CPython-35 # See http://bitly.com/wheel-building-fails-CPython-35
# Verified bug on Python 3.5.1 # Verified bug on Python 3.5.1
wheel==0.32.3 wheel==0.33.1
# Bleeding edge Django # Bleeding edge Django
django==2.1.7 django==2.2.1
django-dynamic-filenames==1.1.4 django-dynamic-filenames==1.1.4
# Configuration # Configuration
django-environ==0.4.5 django-environ==0.4.5
whitenoise==4.1.2 whitenoise==4.1.2
# Static and Media Storage # Static and Media Storage
# ------------------------------------------------ # ------------------------------------------------
boto3==1.9.96 boto3==1.9.142
django-storages==1.7.1 django-storages==1.7.1
# django-storages-redux==1.3.2 # django-storages-redux==1.3.2
@ -20,29 +20,29 @@ django-storages==1.7.1
django-braces==1.13.0 django-braces==1.13.0
django-crispy-forms==1.7.2 django-crispy-forms==1.7.2
django-extensions==2.1.5 django-extensions==2.1.6
Werkzeug==0.14.1 Werkzeug==0.15.2
# Models # Models
django-stdimage==4.0.1 django-stdimage==4.0.1
django-model-utils==3.1.2 django-model-utils==3.1.2
# Images # Images
Pillow==5.4.1 Pillow==6.0.0
# For user registration, either via email or social # For user registration, either via email or social
# Well-built with regular release cycles! # Well-built with regular release cycles!
django-allauth==0.38.0 django-allauth==0.39.1
# Python-PostgreSQL Database Adapter # Python-PostgreSQL Database Adapter
psycopg2==2.7.7 psycopg2==2.8.2
# Unicode slugification # Unicode slugification
awesome-slugify==1.6.5 awesome-slugify==1.6.5
# Time zones support # Time zones support
pytz==2018.9 pytz==2019.1
# Redis support # Redis support
django-redis==4.10.0 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 #fix for use with s3 buckets merged in master, so next release we can remove this
#django-sass-processor==0.5.7 #django-sass-processor==0.5.7
git+https://github.com/jrief/django-sass-processor.git git+https://github.com/jrief/django-sass-processor.git
libsass==0.17.0 libsass==0.18.0
lxml==4.3.1 lxml==4.3.3
# WSGI Handler # WSGI Handler
# ------------------------------------------------ # ------------------------------------------------
gevent==1.4.0 gevent==1.4.0
gunicorn==19.9.0 gunicorn==19.9.0
#https://github.com/jonashaag/bjoern #https://github.com/jonashaag/bjoern
bjoern bjoern==2.2.3
# Your custom requirements go here # Your custom requirements go here
mock==2.0.0 mock==3.0.4
gocardless_pro==1.9.0 gocardless_pro==1.9.0
braintree==3.51.0 braintree==3.53.0
django-autofixture==0.12.1 django-autofixture==0.12.1
wiki==0.4.4 wiki==0.4.4
djangorestframework==3.9.1 djangorestframework==3.9.3
djangorestframework-jwt==1.11.0 djangorestframework-jwt==1.11.0
django-filter==2.1.0 django-filter==2.1.0
coreapi==2.3.3 coreapi==2.3.3
# api libraries end # api libraries end
martor==1.3.8 martor==1.4.0
django-spirit==0.7.0 django-spirit==0.7.1
django-djconfig==0.9.0 django-djconfig==0.10.0
django-haystack==2.8.1 django-haystack==2.8.1
django-xforwardedfor-middleware==2.0 django-xforwardedfor-middleware==2.0
# Application queue # Application queue
huey[backends] huey[backends]==2.0.1
argon2-cffi==19.1.0 argon2-cffi==19.1.0
django-cors-headers==2.4.0 django-cors-headers==2.5.3
python-magic==0.4.15 python-magic==0.4.15
ldap3==2.5.2 ldap3==2.6
bcrypt==3.1.6 bcrypt==3.1.6
python-twitter==3.5 python-twitter==3.5
feedparser==5.2.1 feedparser==5.2.1

View File

@ -2,15 +2,15 @@
-r base.txt -r base.txt
# linting # 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 factory-boy==2.11.1
django-coverage-plugin==1.6.0 django-coverage-plugin==1.6.0
django-test-plus==1.1.1 django-test-plus==1.1.1
# pytest pytest==4.4.1
pytest-django==3.4.7 pytest-django==3.4.8
pytest-sugar==0.9.2 pytest-sugar==0.9.2
model_mommy==1.6.0 model_mommy==1.6.0

View File

@ -39,7 +39,7 @@ services:
huey: huey:
build: build:
context: . context: .
dockerfile: ./compose/django/Dockerfile-dev dockerfile: ./compose/django/Dockerfile
user: django user: django
depends_on: depends_on:
- postgres - postgres