.gitlab-ci.yml 953 Bytes
Newer Older
Håvard Farestveit's avatar
Håvard Farestveit committed
1
image: node:latest
Håvard Farestveit's avatar
Håvard Farestveit committed
2
3
4
5
6
7

stages:
  - build
  - test
  - deploy

8
build:
Håvard Farestveit's avatar
Håvard Farestveit committed
9
  stage: build
10
11
12
13
14
15
16
17
  image: python:3.8.5-slim
  before_script:
    - apt-get clean
    - pip install -r backend/secfit/requirements.txt
  script:
    - cd backend/secfit
    - python manage.py runserver

18
test-backend:
19
  stage: test
Håvard Farestveit's avatar
Håvard Farestveit committed
20
21
22
23
  image: python:3.8.5-slim
  before_script:
    - apt-get clean
    - pip install -r backend/secfit/requirements.txt
24
  script:
25
    - cd backend/secfit
26
27
    - coverage run manage.py test
    - coverage report -m workouts/permissions.py users/serializers.py
28

Håvard Farestveit's avatar
Håvard Farestveit committed
29
deploy-backend:
30
  stage: deploy
Håvard Farestveit's avatar
Håvard Farestveit committed
31
  image: ruby
32
  script:
Håvard Farestveit's avatar
Håvard Farestveit committed
33
34
    - apt-get update -qy
    - apt-get install -y ruby-dev
Håvard Farestveit's avatar
Håvard Farestveit committed
35
    - gem install dpl
Håvard Farestveit's avatar
Håvard Farestveit committed
36
    - cd backend/secfit
Håvard Farestveit's avatar
Håvard Farestveit committed
37
    - dpl --provider=heroku --app=$HEROKU_APP --api-key=$HEROKU_STAGING_API_KEY --skip_cleanup
Håvard Farestveit's avatar
Håvard Farestveit committed
38
39
    - cd ../../frontend
    - dpl --provider=heroku --app=$HEROKU_FRONTEND --api-key=$HEROKU_FRONTEND_API_KEY --skip_cleanup
Håvard Farestveit's avatar
Håvard Farestveit committed
40
  only:
41
    - master
Håvard Farestveit's avatar
Håvard Farestveit committed
42