Skip to content
Snippets Groups Projects
Commit e0b54af9 authored by robinwilliam.hundt's avatar robinwilliam.hundt Committed by Jan Maximilian Michal
Browse files

Update Dockerfile

Added Todo concerning the node_modules folder since the node modules are located at the Project root in development
parent c93d327c
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -42,4 +42,3 @@ scripts/
# yarn stuff
node_modules
.pylintrc
......@@ -15,31 +15,45 @@ build:
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
test:
.test_template: &test_definition
stage: test
image: $IMAGE_TAG
test_coverage:
<<: *test_definition
services:
- postgres:9.5
script:
- coverage run manage.py test --noinput
- coverage report --skip-covered
staging:
test_pylint:
<<: *test_definition
script:
- pylint core || exit 0
.staging_template: &staging_definition
stage: staging
image: docker:latest
only:
- master
staging:
<<: *staging_definition
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://staging.grady.janmax.org
on_stop: staging_stop
script:
- apk add --update py-pip && pip install docker-compose
- docker-compose up -d
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker-compose pull
- docker-compose up -d --build
staging_stop:
stage: staging
image: docker:latest
variables:
GIT_STRATEGY: none
<<: *staging_definition
script:
- apk add --update py-pip && pip install docker-compose
- docker-compose rm --force --stop
......
.pylintrc 0 → 100644
[MASTER]
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS, migrations, static, env, docs, manage.py
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Use multiple processes to speed up Pylint.
jobs=2
# Pickle collected data for later comparisons.
persistent=yes
# When enabled, pylint would attempt to guess common misconfiguration and emit
# user-friendly hints instead of false-positive error messages
suggestion-mode=yes
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
[MESSAGES CONTROL]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
raw-checker-failed,
bad-inline-option,
locally-disabled,
locally-enabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating
[REPORTS]
# Tells whether to display a full report or only the messages
reports=yes
# Activate the evaluation score.
score=yes
[REFACTORING]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
......@@ -17,7 +17,7 @@ ENV PYTHONUNBUFFERED 1
# This set is need otherwise the postgres driver wont work
RUN apk update \
&& apk add --virtual build-deps gcc python3-dev musl-dev \
&& apk add postgresql-dev \
&& apk add --no-cache postgresql-dev \
&& pip install psycopg2 \
&& apk del build-deps
......@@ -28,6 +28,8 @@ WORKDIR /code
COPY . /code
COPY --from=python /root/.cache /root/.cache
COPY --from=python /words /usr/share/dict/words
# TODO this won't be necessarry anymore once merged with development
# since the node_modules are served form the Project Root there
COPY --from=node /node_modules core/static/node_modules
RUN pip install -r requirements.txt && rm -rf /root/.cache
......@@ -3,8 +3,9 @@ APP_LIST ?= core grady util
.PHONY: collectstatic run install migrations-check isort isort-check build-webpack
collectstatic:
./manage.py compress
collectstatic: # used only in production
./manage.py collectstatic --ignore node_modules
./manage.py compress --force
run:
python manage.py runserver 0.0.0.0:8000
......
......@@ -9,12 +9,12 @@ services:
- /bin/sh
- -c
- |
python3 manage.py compress
python3 manage.py collectstatic
python3 manage.py migrate --noinput
python3 manage.py loaddata core/fixtures/testdata-groups.json
python3 manage.py loaddata core/fixtures/testdata-user.json
python3 manage.py loaddata core/fixtures/testdata-core.json
python manage.py collectstatic --ignore node_modules --noinput --clear
python manage.py compress --force
python manage.py migrate --noinput
python manage.py loaddata core/fixtures/testdata-groups.json
python manage.py loaddata core/fixtures/testdata-user.json
python manage.py loaddata core/fixtures/testdata-core.json
gunicorn --bind 0.0.0.0:8000 grady.wsgi:application
ports:
- "8000:8000"
......
......@@ -12,7 +12,7 @@ DEBUG = False
COMPRESS_ENABLED = not DEBUG
# adjust this setting to your needs
ALLOWED_HOSTS = ['localhost', '.janmax.org']
ALLOWED_HOSTS = ['localhost', '.grady.janmax.org']
# sample postgres sql database configuration
DATABASES = {
......
......@@ -6,3 +6,4 @@ gunicorn~=19.7.0
psycopg2~=2.7.1
xlrd~=1.0.0
pytest-cov~=2.5.1
pylint~=1.7.4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment