aboutsummaryrefslogtreecommitdiffstats
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml131
1 files changed, 59 insertions, 72 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 144260ff..5389495a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,78 +1,65 @@
-image: pythondiscord/site-ci:latest
-
-variables:
- RABBITMQ_HOST: rabbit
- RETHINKDB_HOST: rethinkdb
-
stages:
-# - build
- - test
-# - deploy
-#
-#build:
-# before_script:
-# - docker info
-#
-# image: docker:stable-git
-#
-# only:
-# - master
-#
-# services:
-# - docker:dind
-#
-# stage: build
-#
-# script:
-# - sh scripts/deploy-ci.sh
-#
-# tags:
-# - docker
-#
-# variables:
-# DOCKER_DRIVER: overlay2
+ - build
+ - lint
+ - test
+ - deploy
-test:
- tags:
- - docker
+cache:
+ paths:
+ - .cache/
- stage: test
-# services:
-# - name: rabbitmq:3.7.5-alpine
-# alias: rabbit
-#
-# - name: rethinkdb:2.3.6
-# alias: rethinkdb
+variables:
+ PIPENV_CACHE_DIR: "$CI_PROJECT_DIR/.cache"
- cache:
- paths:
- - ".venv"
- - ".gem"
+build base image:
+ image: docker:stable-git
+ stage: build
+ script:
+ - sh scripts/deploy-ci.sh
+ tags:
+ - docker
+ only:
+ - master
+ - django
- script:
- - pipenv sync --dev
+lint:
+ image: registry.gitlab.com/python-discord/projects/site/django-base:latest
+ stage: lint
+ script:
+ - pipenv install --dev
+ - flake8
+
+test:
+ image: registry.gitlab.com/python-discord/projects/site/django-base:latest
+ stage: test
+ services:
+ - postgres:10-alpine
+ before_script:
+ - python manage.py migrate
+ - pip install coverage
+ script:
+ - coverage run --source=api,home,pysite,wiki --branch manage.py test
+ after_script:
+ - coverage report
+ artifacts:
+ paths:
+ - .coverage
+ variables:
+ DATABASE_URL: postgres://django:supersecret@postgres/pysite
+ POSTGRES_DB: pysite
+ POSTGRES_PASSWORD: supersecret
+ POSTGRES_USER: django
- - pipenv run lint
-# - pipenv run lintjs
-# - pipenv run lintscss
-#
-# - pipenv run python gunicorn_config.py
-# - pipenv run test
-#
-#deploy:
-# tags:
-# - docker
-#
-# only:
-# - master
-#
-# services:
-# - docker:dind
-#
-# stage: deploy
-# script:
-# - sh scripts/deploy.sh
-#
-# environment:
-# name: Production
-# url: https://pythondiscord.com
+pages:
+ stage: deploy
+ image:
+ dependencies:
+ - test
+ before_script:
+ - pip install coverage
+ script:
+ - coverage html --directory=public
+ artifacts:
+ paths:
+ - public
+ expire_in: 30 days