.gitlab-ci.yml 1.54 KB
Newer Older
David Haynes's avatar
David Haynes committed
1
services:
David Haynes's avatar
David Haynes committed
2
  - mysql:5.7
David Haynes's avatar
David Haynes committed
3 4 5 6 7

variables:
  MYSQL_DATABASE: wopen
  MYSQL_ROOT_PASSWORD: root

8 9 10 11 12
types:
  - test

before_script:
  - apt-get update -qy
Michael R Lundquist's avatar
Michael R Lundquist committed
13
  - apt-get install -y default-mysql-client default-libmysqlclient-dev python-mysqldb graphviz
14
    gdal-bin libproj-dev proj-data proj-bin binutils
15
  - cd whats-open/
16 17
  - pip install pipenv
  - pipenv install --system --deploy
18 19
  - export WOPEN_SECRET_KEY=$(dd if=/dev/urandom count=100 | tr -dc "A-Za-z0-9"
    | fold -w 60 | head -n1 2>/dev/null)
20 21
  - export WOPEN_EMAIL_DOMAIN="@masonlive.gmu.edu"
  - export WOPEN_DB_NAME="wopen"
22 23
  - export WOPEN_DB_USER="root"
  - export WOPEN_DB_PASSWORD="root"
24 25 26
  - export WOPEN_DB_HOST="mysql"
  - export WOPEN_DB_PORT=3306
  - export WOPEN_SUPERUSER=admin
David Haynes's avatar
David Haynes committed
27
  - export WOPEN_ENV=dev
28
  - python manage.py makemigrations
29
  - python manage.py makemigrations api
30
  - python manage.py migrate
Michael R Lundquist's avatar
Michael R Lundquist committed
31 32
  - echo "from django.contrib.auth.models import User; User.objects.filter(username='$WOPEN_SUPERUSER$WOPEN_EMAIL_DOMAIN').delete(); User.objects.create_superuser('$WOPEN_SUPERUSER$WOPEN_EMAIL_DOMAIN', '$WOPEN_SUPERUSER', 'admin')" | python manage.py shell
  - python3 manage.py loaddata --format json categoriesFixture locationFixture openTimeFixture scheduleFixture settingsFixture
Michael R Lundquist's avatar
Michael R Lundquist committed
33 34 35
  - python manage.py graph_models --dot --group api > erd.dot
  - dot -Tpng erd.dot > erd.png
  
David Haynes's avatar
David Haynes committed
36
whats-open-py3.7:
Michael R Lundquist's avatar
Michael R Lundquist committed
37 38 39 40
  artifacts:
    paths:
      - whats-open/erd.png
    expire_in: 1 week
David Haynes's avatar
David Haynes committed
41
  image: library/python:3.7
42 43
  type: test
  script:
Michael R Lundquist's avatar
Michael R Lundquist committed
44
    - python3 manage.py test --verbosity 2 --keepdb --noinput api.tests.APIClientTests