.gitlab-ci.yml 1.28 KB
Newer Older
Jerome Flesch's avatar
Jerome Flesch committed
1
2
image: debian:stable-slim

3
stages:
4
  - test
Jerome Flesch's avatar
Jerome Flesch committed
5
  - deploy
6

Jerome Flesch's avatar
Jerome Flesch committed
7
check:
8
  stage: test
Jerome Flesch's avatar
Jerome Flesch committed
9
10
11
12
  tags:
    - linux
    - volatile
  script:
13
    - sh ./set_apt_proxy.sh
Jerome Flesch's avatar
Jerome Flesch committed
14
15
16
    - apt-get install -y -q make
    - apt-get install -y -q pycodestyle flake8 python3-flake8 tox
    - make check
17

18
deploy_testing:
Jerome Flesch's avatar
Jerome Flesch committed
19
  stage: deploy
20
  only:
21
    - testing@World/OpenPaperwork/openpaper.work
22
  tags:
23
    - openpaper.work-testing
24
25
26
  variables:
    DOCKER_CLIENT_TIMEOUT: "1800"
    COMPOSE_HTTP_TIMEOUT: "1800"
27
  script:
Jerome Flesch's avatar
Jerome Flesch committed
28
29
30
    - rm -f db.env django.env
    - cp /etc/openpaper.work/db.env .
    - cp /etc/openpaper.work/django.env .
31
    - docker-compose -p openpaper_work pull
32
    - docker-compose -p openpaper_work build
33
    - docker-compose -p openpaper_work up -d
Jerome Flesch's avatar
Jerome Flesch committed
34
35
    - docker container prune -f
    - docker image prune -f
36

37
deploy_production:
Jerome Flesch's avatar
Jerome Flesch committed
38
  stage: deploy
39
40
41
  only:
    - master@World/OpenPaperwork/openpaper.work
  tags:
42
43
44
45
    - openpaper.work-master
  variables:
    DOCKER_CLIENT_TIMEOUT: "1800"
    COMPOSE_HTTP_TIMEOUT: "1800"
46
  script:
47
48
49
50
51
52
53
54
    - rm -f db.env django.env
    - cp /etc/openpaper.work/db.env .
    - cp /etc/openpaper.work/django.env .
    - docker-compose -p openpaper_work pull
    - docker-compose -p openpaper_work build
    - docker-compose -p openpaper_work up -d
    - docker container prune -f
    - docker image prune -f