.gitlab-ci.yml 1.45 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_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)]))')
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  - export GO_DB_NAME="go"
  - export GO_DB_USER="root"
  - export GO_DB_PASSWORD="root"
  - export GO_DB_HOST="mysql"
  - 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=
33
34
35
36
37
  - 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
38
39
Go-py3.7:
  image: library/python:3.7
40
  stage: test
David Haynes's avatar
David Haynes committed
41
42
43
  script:
    - python manage.py test

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