.gitlab-ci.yml 1.3 KB
Newer Older
1
services:
2
  - registry.srct.gmu.edu/srct/go/db
David Haynes's avatar
David Haynes committed
3

4
stages:
5
  - test
6
  - lint
7

8 9 10 11
variables:
  MYSQL_DATABASE: go
  MYSQL_ROOT_PASSWORD: root

12 13
before_script:
  - apt-get update -qy
Zac Wood's avatar
Zac Wood committed
14
  - apt-get install -y default-libmysqlclient-dev python-mysqldb redis-server
15
  - pip install -r requirements/ci.txt
David Haynes's avatar
David Haynes committed
16
  - nohup redis-server &
17
  - cd go/
Zac Wood's avatar
Zac Wood committed
18
  - export GO_ENV="test"
Zac Wood's avatar
Zac Wood committed
19
  - export GO_SECRET_KEY="secret"
20 21 22
  - export GO_DB_NAME="go"
  - export GO_DB_USER="root"
  - export GO_DB_PASSWORD="root"
Zac Wood's avatar
Zac Wood committed
23
  - export GO_DB_HOST="db"
24 25 26 27 28 29 30 31 32 33
  - export GO_DB_PORT=3306
  - export GO_ALLOWED_HOSTS="*"
  - export GO_EMAIL_DOMAIN="@masonlive.gmu.edu"
  - export GO_CAS_URL="https://cas.srct.gmu.edu/"
  - export GO_EMAIL_HOST=
  - export GO_EMAIL_PORT=
  - export GO_EMAIL_HOST_USER=
  - export GO_EMAIL_HOST_PASSWORD=
  - export GO_EMAIL_FROM=
  - export GO_EMAIL_TO=
34 35 36 37 38
  - python manage.py makemigrations
  - python manage.py makemigrations go
  - python manage.py migrate
  - echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('root', 'root@srct.gmu.edu', 'root') " | python manage.py shell

Zac Wood's avatar
Zac Wood committed
39 40
Go-py3.7:
  image: library/python:3.7
41
  stage: test
David Haynes's avatar
David Haynes committed
42 43 44
  script:
    - python manage.py test

45
Go-flake8:
Zac Wood's avatar
Zac Wood committed
46
  image: library/python:3.7
47 48 49
  stage: lint
  script:
    - pip install flake8
Zac Wood's avatar
Zac Wood committed
50
    - flake8 go/ --statistics --exit-zero