.gitlab-ci.yml 1.52 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
  - export GO_DB_PORT=3306
  - export GO_ALLOWED_HOSTS="*"
  - export GO_EMAIL_DOMAIN="@masonlive.gmu.edu"
Zac Wood's avatar
Zac Wood committed
28
  - export GO_CAS_URL="https://login.gmu.edu"
29
30
31
32
33
34
  - 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=
Zac Wood's avatar
Zac Wood committed
35
  - export GO_STATIC_ROOT=/static
36
37
38
39
40
  - 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
41
42
Go-py3.7:
  image: library/python:3.7
43
  stage: test
David Haynes's avatar
David Haynes committed
44
45
46
  script:
    - python manage.py test

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