.gitlab-ci.yml 1.15 KB
Newer Older
Eliot Berriot's avatar
Attempt    
Eliot Berriot committed
1
2
stages:
  - test
Eliot Berriot's avatar
Eliot Berriot committed
3
  - build
4
  - deploy
Eliot Berriot's avatar
Eliot Berriot committed
5
6
7

test_api:
  stage: test
8
  image: funkwhale/funkwhale:base
Eliot Berriot's avatar
Eliot Berriot committed
9
  before_script:
10
11
    - cd api
    - pip install -r requirements/test.txt
Eliot Berriot's avatar
Eliot Berriot committed
12
  script:
13
    - pytest
Eliot Berriot's avatar
Eliot Berriot committed
14
15

  tags:
16
    - docker
Eliot Berriot's avatar
Eliot Berriot committed
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

build_front:
  stage: build
  image: node:6-alpine
  before_script:
    - cd front

  script:
    - npm install
    - npm run build
  cache:
    key: "$CI_COMMIT_REF_NAME"
    paths:
      - front/node_modules
  artifacts:
    name: "front_${CI_COMMIT_REF_NAME}"
    paths:
      - front/dist/
  only:
    - master
    - develop
  tags:
    - docker
40

41

42
pages:
Eliot Berriot's avatar
Attempt    
Eliot Berriot committed
43
  stage: test
44
45
46
47
48
49
50
51
  image: alpine
  before_script:
    - cd docs
  script:
    - apk --no-cache add py2-pip python-dev
    - pip install sphinx
    - apk --no-cache add make
    - make html
Eliot Berriot's avatar
Attempt    
Eliot Berriot committed
52
    - mv _build/html/ ../public
53
54
55
56
  artifacts:
    paths:
      - public
  only:
57
    - develop
Eliot Berriot's avatar
Eliot Berriot committed
58
59
  tags:
    - docker
60
61
62
63

docker_image:
  stage: test
  before_script:
64
    - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
65
66
67
68
69
70
71
72
73
    - cd api
  script:
    - docker build -t funkwhale/funkwhale:$CI_COMMIT_REF_NAME .
    - docker push funkwhale/funkwhale:$CI_COMMIT_REF_NAME
  only:
    - develop
    - master
  tags:
    - dind