-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Major changes (including Django 1.11 and Python 3) (#178)
- Add Docker setup - Add Sentry support for error tracking - Update to Django 1.11 - Update to Python 3.6 - Update dependencies - Pin dependencies - Vendor in django-faq - Format code with black - Convert codebase indents to spaces - Order imports with isort - Remove south migrations - Replace Piston-based API with DRF (note: it's a quick replacement, expect 500s on invalid data, gameserver version detection isn't ported) - Implement envvar-based configuration - Replace brabeion with pinax.badges - Remove django-admin-tools - Move static assets to static dir from media
- Loading branch information
Showing
502 changed files
with
8,393 additions
and
13,815 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.git/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,6 @@ teerace/teerace.cache/ | |
build/ | ||
pip-log.txt | ||
src/ | ||
.env | ||
celerybeat.pid | ||
celerybeat-schedule |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ARG PYTHON_TAG=3.6.5-alpine3.7 | ||
|
||
# Builder image | ||
FROM python:${PYTHON_TAG} AS builder | ||
RUN apk add --no-cache \ | ||
gettext-dev \ | ||
postgresql-dev \ | ||
gcc \ | ||
musl-dev \ | ||
pcre-dev | ||
RUN mkdir /wheels | ||
WORKDIR /wheels | ||
COPY requirements.txt /wheels/requirements.txt | ||
RUN pip wheel -r requirements.txt | ||
|
||
# Final image | ||
FROM python:${PYTHON_TAG} | ||
ARG PROJECT_NAME=teerace | ||
ENV PYTHONUNBUFFERED 1 | ||
ENV PROJECT_NAME ${PROJECT_NAME} | ||
ENV GIT_COMMIT ${GIT_COMMIT} | ||
|
||
RUN apk add --no-cache \ | ||
libpq \ | ||
pcre \ | ||
gettext | ||
COPY --from=builder /wheels /wheels | ||
RUN pip install \ | ||
-r /wheels/requirements.txt \ | ||
-f /wheels \ | ||
&& rm -rf /wheels \ | ||
&& rm -rf /root/.cache/pip | ||
RUN addgroup -S app \ | ||
&& adduser -S -G app app | ||
RUN mkdir /code | ||
WORKDIR /code | ||
COPY --chown=app:app setup.cfg entrypoint.sh ${PROJECT_NAME} /code/ | ||
# ADD tests /code/tests | ||
USER app | ||
WORKDIR /code/${PROJECT_NAME}/ | ||
|
||
ENTRYPOINT ["../entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
recursive-include teerace/media * | ||
recursive-include teerace/templates * | ||
|
||
include LICENCE | ||
include LICENSE | ||
include README | ||
include *.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
COMPOSE_FILE?=dev.yml | ||
BASE=docker-compose -f $(COMPOSE_FILE) | ||
RUN_DJANGO = $(BASE) run --rm django | ||
|
||
shell: | ||
$(RUN_DJANGO) manage shell | ||
|
||
shell_plus: | ||
$(RUN_DJANGO) manage shell_plus | ||
|
||
migrate: | ||
$(RUN_DJANGO) manage migrate | ||
|
||
makemigrations: | ||
$(RUN_DJANGO) manage makemigrations | ||
|
||
test: | ||
$(BASE) run django pytest | ||
|
||
sh: | ||
$(RUN_DJANGO) sh | ||
|
||
up: | ||
$(BASE) up | ||
|
||
stop: | ||
$(BASE) stop | ||
|
||
down: | ||
$(BASE) down | ||
|
||
build: | ||
$(BASE) build | ||
|
||
runserver: | ||
$(BASE) run --service-ports --rm django runserver | ||
|
||
runserver_plus: | ||
$(BASE) run --service-ports --rm django runserver_plus | ||
|
||
outdated: | ||
$(BASE) pip list --outdated --format=columns | ||
|
||
isort: | ||
$(RUN_DJANGO) isort | ||
|
||
mypy: | ||
$(RUN_DJANGO) mypy | ||
|
||
black: | ||
$(RUN_DJANGO) black | ||
|
Oops, something went wrong.