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

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

  tags:
16
    - docker
Agate's avatar
Agate 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

Agate's avatar
Agate committed
42
pages:
Agate's avatar
Attempt  
Agate committed
43
  stage: test
Agate's avatar
Agate committed
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
Agate's avatar
Attempt  
Agate committed
52
    - mv _build/html/ ../public
Agate's avatar
Agate committed
53 54 55 56
  artifacts:
    paths:
      - public
  only:
57
    - develop
Agate's avatar
Agate committed
58 59
  tags:
    - docker
60 61

docker_image:
Agate's avatar
Agate committed
62
  stage: deploy
63
  before_script:
Agate's avatar
Agate committed
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