From 3754fa2542e46dddc842d662d00b9d344093220e Mon Sep 17 00:00:00 2001 From: Beichi-CHs Date: Thu, 18 Nov 2021 12:38:49 +0800 Subject: [PATCH] upgrade build configration --- .gitignore | 2 ++ .travis.yml | 10 ++++++--- Dockerfile | 4 ++-- deploy/requirements.txt | 49 +++++++++++++++++++++-------------------- 4 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 8b3b73ff..6dbdf64c 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,5 @@ http_locations.conf https_locations.conf venv/ +#test docker-compose +docker-compose.yml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index ac84fa0a..a4465e41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,16 +1,20 @@ language: python python: - - "3.6" + - "3.8" services: - docker + - postgresql install: + - pip install psycopg2 - pip install -r deploy/requirements.txt - echo `cat /dev/urandom | head -1 | md5sum | head -c 32` > data/config/secret.key - ./init_db.sh script: - docker ps -a - - flake8 . + - flake8 --config=./.flake8 . - coverage run --include="$PWD/*" manage.py test - coverage report notifications: - slack: onlinejudgeteam:BzBz8UFgmS5crpiblof17K2W + email: + - beichi.dev@gmail.com + - 841734459@qq.com diff --git a/Dockerfile b/Dockerfile index f66305b3..a43e4d6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM python:3.7-alpine3.9 +FROM python:3.8-alpine3.14 ENV OJ_ENV production ADD . /app WORKDIR /app -HEALTHCHECK --interval=5s --retries=3 CMD python2 /app/deploy/health_check.py +HEALTHCHECK --interval=5s --retries=3 CMD python3 /app/deploy/health_check.py RUN apk add --update --no-cache build-base nginx openssl curl unzip supervisor jpeg-dev zlib-dev postgresql-dev freetype-dev && \ pip install --no-cache-dir -r /app/deploy/requirements.txt && \ diff --git a/deploy/requirements.txt b/deploy/requirements.txt index b0c6fe9b..7df82325 100644 --- a/deploy/requirements.txt +++ b/deploy/requirements.txt @@ -1,32 +1,33 @@ certifi==2019.3.9 chardet==3.0.4 -coverage==4.5.3 -Django==2.1.7 -django-redis==4.10.0 -djangorestframework==3.8.2 +coverage==6.1.2 +Django==3.2.9 +django-redis==5.0.0 +djangorestframework==3.12.4 entrypoints==0.3 Envelopes==0.4 -flake8==3.7.7 -flake8-coding==1.3.1 -flake8-quotes==1.0.0 -gunicorn==19.9.0 -idna==2.8 -jsonfield==2.0.2 +flake8==4.0.1 +flake8-coding==1.3.2 +flake8-quotes==3.3.1 +gunicorn==20.1.0 +idna==3.3 +jsonfield==3.1.0 mccabe==0.6.1 otpauth==1.0.1 -Pillow==5.4.1 -psycopg2-binary==2.7.7 -pycodestyle==2.5.0 -pyflakes==2.1.1 -python-dateutil==2.8.0 -pytz==2018.9 -qrcode==6.1 +Pillow==8.4.0 +psycopg2-binary==2.9.2 +pycodestyle==2.8.0 +pyflakes==2.4.0 +python-dateutil==2.8.2 +pytz==2021.3 +qrcode==7.3.1 raven==6.10.0 -redis==3.2.0 -requests==2.21.0 -six==1.12.0 -urllib3==1.24.1 -XlsxWriter==1.1.5 -django-dramatiq==0.5.0 -dramatiq==1.3.0 +redis==3.5.3 +requests==2.26.0 +six==1.16.0 +urllib3==1.26.7 +XlsxWriter==3.0.2 +django-dramatiq==0.10.0 +dramatiq==1.12.0 django-dbconn-retry==0.1.5 +django-cas-ng==4.2.1