---

image: python:2.7

services:
  - mysql:5.7

variables:
  DJANGO_SECRET_KEY: foobarbazbazbarfoo
  MYSQL_ROOT_PASSWORD: internewshid
  MYSQL_DATABASE: internewshid

before_script:
  - ln -srf internewshid/local_settings.py.gitlab internewshid/local_settings.py
  - echo "SECRET_KEY = '$DJANGO_SECRET_KEY'" >> internewshid/private_settings.py
  - echo "DB_PASSWORD = '$MYSQL_ROOT_PASSWORD'" >> internewshid/private_settings.py
  - apt update && apt install -y default-libmysqlclient-dev python-pymysql python-mysqldb nodejs node-less
  - pip install pipenv && pipenv sync --dev

gitlab-ci:
  script:
    - pipenv run python manage.py check
    - pipenv run pylava -o setup.cfg
    - pipenv run isort -q -rc -c -df -sp setup.cfg
    - pipenv run pytest -v --cov