diff options
-rw-r--r-- | .dockerignore | 20 | ||||
-rw-r--r-- | .gitlab-ci.yml | 54 | ||||
-rw-r--r-- | docker/app/alpine/3.6/Dockerfile | 4 | ||||
-rw-r--r-- | docker/app/alpine/3.7/Dockerfile | 2 | ||||
-rw-r--r-- | docker/app/stretch/3.6/Dockerfile | 4 | ||||
-rw-r--r-- | docker/app/stretch/3.7/Dockerfile | 3 |
6 files changed, 46 insertions, 41 deletions
diff --git a/.dockerignore b/.dockerignore index b2eb2073..47f1eabf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,16 +1,16 @@ -.venv -scripts -htmlcov -__pycache__ -.vagrant -.pytest_cache -.git -.github -.gitlab .cache -Vagrantfile .coverage .coveragerc +.git +.github .gitignore +.gitlab +.pytest_cache .travis.yml +.vagrant +.venv +__pycache__ docker +htmlcov +scripts +Vagrantfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fdb41c13..66e83da9 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ image: python:3.7-alpine .test-template: &test-template stage: test services: - - postgres:10-alpine + - postgres:11-alpine script: - python manage.py test tags: @@ -62,6 +62,8 @@ build-stretch-3.6: lint: stage: lint + dependencies: + - build-alpine-3.7 image: docker:dind before_script: - docker load < django_alpine_py37.tar.gz @@ -69,55 +71,55 @@ lint: - docker run django:alpine-3.7 flake8 tags: - docker - dependencies: - - build-alpine-3.7 - test-3.7-alpine: <<: *test-template image: docker:dind + dependencies: + - build-alpine-3.7 before_script: - - docker load < django:alpine-3.7 + - docker load < docker_alpine_py37.tar.gz - docker run --network=host --env DATABASE_URL=$DATABASE_URL django:alpine-3.7 python manage.py migrate script: - docker container run --network=host --env DATABASE_URL=$DATABASE_URL -v ./:/app django:alpine-3.7 coverage run --source=api,home,pysite,wiki --branch manage.py test after_script: - - docker contianer run -v ./:/app coverage report + - docker container run -v ./:/app coverage report artifacts: paths: - .coverage - dependencies: - - build-alpine-3.7 test-3.6-alpine: <<: *test-template - image: python:3.6-alpine + image: docker:dind + dependencies: + - build-alpine-3.6 before_script: - - apk add git libpq postgresql-dev gcc cmake autoconf automake musl-dev - - python3 -m pip install --no-cache-dir .[test] - - python manage.py migrate + - docker load < docker_alpine_py36.tar.gz + - docker run --network=host --env DATABASE_URL=$DATABASE_URL django:alpine-3.6 python manage.py migrate + script: + - docker container run --network=host --env DATABASE_URL=$DATABASE_URL django:alpine-3.6 python manage.py test test-3.7-stretch: <<: *test-template - image: python:3.7-stretch - services: - - postgres:11 + image: docker:dind + dependencies: + - build-stretch-3.7 before_script: - - apt-get update -y - - apt-get install -y git libpq-dev gcc cmake autoconf automake libc-dev - - python3 -m pip install --no-cache-dir .[test] - - python manage.py migrate + - docker load < docker_stretch_py37.tar.gz + - docker run --network=host --env DATABASE_URL=$DATABASE_URL django:stretch-3.7 python manage.py migrate + script: + - docker container run --network=host --env DATABASE_URL=$DATABASE_URL django:stretch-3.7 python manage.py test test-3.6-stretch: <<: *test-template - image: python:3.6-stretch - services: - - postgres:11 + image: docker:dind + dependencies: + - build-stretch-3.6 before_script: - - apt-get update -y - - apt-get install -y git libpq-dev gcc cmake autoconf automake libc-dev - - python3 -m pip install --no-cache-dir .[test] - - python manage.py migrate + - docker load < docker_stretch_py36.tar.gz + - docker run --network=host --env DATABASE_URL=$DATABASE_URL django:stretch-3.6 python manage.py migrate + script: + - docker container run --network=host --env DATABASE_URL=$DATABASE_URL django:stretch-3.6 python manage.py test pages: stage: publish diff --git a/docker/app/alpine/3.6/Dockerfile b/docker/app/alpine/3.6/Dockerfile index 2819c8d6..e4b75649 100644 --- a/docker/app/alpine/3.6/Dockerfile +++ b/docker/app/alpine/3.6/Dockerfile @@ -14,8 +14,8 @@ RUN apk add \ COPY . /app WORKDIR /app - RUN python3 -m pip install .[$EXTRAS] + RUN apk del \ autoconf \ automake \ @@ -23,4 +23,4 @@ RUN apk del \ gcc \ git -CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:applicati +CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:application"] diff --git a/docker/app/alpine/3.7/Dockerfile b/docker/app/alpine/3.7/Dockerfile index f2c7bcdf..33a6c12c 100644 --- a/docker/app/alpine/3.7/Dockerfile +++ b/docker/app/alpine/3.7/Dockerfile @@ -14,8 +14,8 @@ RUN apk add \ COPY . /app WORKDIR /app - RUN python3 -m pip install .[$EXTRAS] + RUN apk del \ autoconf \ automake \ diff --git a/docker/app/stretch/3.6/Dockerfile b/docker/app/stretch/3.6/Dockerfile index 46bc1247..0eb064ea 100644 --- a/docker/app/stretch/3.6/Dockerfile +++ b/docker/app/stretch/3.6/Dockerfile @@ -13,6 +13,8 @@ RUN apt-get install -y \ libpq-dev +COPY . /app +WORKDIR /app RUN python3 -m pip install .[$EXTRAS] -CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:applicati +CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:application"] diff --git a/docker/app/stretch/3.7/Dockerfile b/docker/app/stretch/3.7/Dockerfile index 0290b800..9a838fd9 100644 --- a/docker/app/stretch/3.7/Dockerfile +++ b/docker/app/stretch/3.7/Dockerfile @@ -12,7 +12,8 @@ RUN apt-get install -y \ libc-dev \ libpq-dev - +COPY . /app +WORKDIR /app RUN python3 -m pip install .[$EXTRAS] CMD ["gunicorn", "--workers", "4", "--bind", "0.0.0.0:4000", "pysite.wsgi:applicati |