.gitlab-ci.yml 1.5 KB
Newer Older
1
services:
Zac Wood's avatar
RTFM  
Zac Wood committed
2 3
  - name: registry.srct.gmu.edu/srct/go/db
    alias: mysql
David Haynes's avatar
David Haynes committed
4

5
stages:
6
  - test
7
  - lint
8

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

13 14
before_script:
  - apt-get update -qy
Zac Wood's avatar
Zac Wood committed
15
  - apt-get install -y default-libmysqlclient-dev python-mysqldb redis-server
16
  - pip install -r requirements/ci.txt
David Haynes's avatar
David Haynes committed
17
  - nohup redis-server &
18
  - cd go/
Zac Wood's avatar
Zac Wood committed
19
  - export GO_ENV="test"
Zac Wood's avatar
Zac Wood committed
20
  - export GO_SECRET_KEY=$(python -c 'import random; import string; print("".join([random.SystemRandom().choice("{}{}{}".format(string.ascii_letters, string.digits, string.punctuation)) for i in range(50)]))')
21 22 23
  - export GO_DB_NAME="go"
  - export GO_DB_USER="root"
  - export GO_DB_PASSWORD="root"
Zac Wood's avatar
RTFM  
Zac Wood committed
24
  - export GO_DB_HOST="mysql"
25 26 27 28 29 30 31 32 33 34
  - 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=
35 36 37 38 39
  - 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
40 41
Go-py3.7:
  image: library/python:3.7
42
  stage: test
David Haynes's avatar
David Haynes committed
43 44 45
  script:
    - python manage.py test

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