.gitlab-ci.yml 1.47 KB
Newer Older
1
2
variables:
  IMAGE_NAME: funkwhale/funkwhale
3
  IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
4
5
6
7
  IMAGE_LATEST: $IMAGE_NAME:latest



Eliot Berriot's avatar
Attempt    
Eliot Berriot committed
8
9
stages:
  - test
Eliot Berriot's avatar
Eliot Berriot committed
10
  - build
11
  - deploy
Eliot Berriot's avatar
Eliot Berriot committed
12
13
14

test_api:
  stage: test
15
  image: funkwhale/funkwhale:base
Eliot Berriot's avatar
Eliot Berriot committed
16
  before_script:
17
18
    - cd api
    - pip install -r requirements/test.txt
Eliot Berriot's avatar
Eliot Berriot committed
19
  script:
20
    - pytest
Eliot Berriot's avatar
Eliot Berriot committed
21
22

  tags:
23
    - docker
Eliot Berriot's avatar
Eliot Berriot committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

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:
43
    - tags
Eliot Berriot's avatar
Eliot Berriot committed
44
45
46
47
    - master
    - develop
  tags:
    - docker
48

49

50
pages:
Eliot Berriot's avatar
Attempt    
Eliot Berriot committed
51
  stage: test
52
53
54
55
56
57
58
59
  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
60
    - mv _build/html/ ../public
61
62
63
64
  artifacts:
    paths:
      - public
  only:
65
    - develop
Eliot Berriot's avatar
Eliot Berriot committed
66
67
  tags:
    - docker
68

69
docker_develop:
70
  stage: deploy
71
  before_script:
72
    - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
73
74
    - cd api
  script:
75
76
    - docker build -t $IMAGE .
    - docker push $IMAGE
77
78
  only:
    - develop
79
80
81
82
83
84
85
86
87
88
89
90
91
  tags:
    - dind

docker_release:
  stage: deploy
  before_script:
    - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
    - cd api
  script:
    - docker build -t $IMAGE -t $IMAGE_LATEST .
    - docker push $IMAGE
    - docker push $IMAGE_LATEST
  only:
92
    - tags
93
94
  tags:
    - dind