Files
web2.0-backend/.gitlab-ci.yml
T
2017-05-17 14:45:00 +03:00

43 lines
890 B
YAML

image: python:3.5
services:
- postgres:latest
variables:
POSTGRES_DB: ci
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
before_script:
- python -V
- pip install -r requirements.txt
stages:
- build
- test
- lint
build:
stage: build
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script:
- cp sikweb/ci-settings.py sikweb/settings.py
- python manage.py migrate --noinput
- python manage.py createdefaultadmin
test:
stage: test
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script:
- docker-compose run web python manage.py test
lint:
stage: lint
variables:
DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB"
script:
- pep8 --count && eslint .