.gitlab-ci.yml 1.37 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
13
  - apt-get install -y default-mysql-client default-libmysqlclient-dev python-mysqldb
David Haynes's avatar
David Haynes committed
14
    gdal-bin libproj-dev proj-data proj-bin binutils
15
  - cd whats-open/
16
17
  - pip install pipenv
  - pipenv install --system --deploy
David Haynes's avatar
David Haynes committed
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
David Haynes's avatar
David Haynes committed
33
34
whats-open-py3.7:
  image: library/python:3.7
35
36
  type: test
  script:
Michael R Lundquist's avatar
Michael R Lundquist committed
37
    - python3 manage.py test --verbosity 2 --keepdb --noinput api.tests.APIClientTests