.gitlab-ci.yml 1.11 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

Jerome Flesch's avatar
Jerome Flesch committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
tests:
  stage: test
  tags:
    - linux
    - volatile
  script:
    - sh ./set_apt_proxy.sh
    - apt-get install -y -q make
    - apt-get install -y -q libmariadbclient-dev build-essential
    - apt-get install -y -q python3 python3-dev python3-pip
    - apt-get install -y -q gettext npm
    - pip3 install -r ./requirements.txt
    - make test

32
deploy_production:
Jerome Flesch's avatar
Jerome Flesch committed
33
  stage: deploy
34
35
36
  only:
    - master@World/OpenPaperwork/openpaper.work
  tags:
37
38
39
40
    - openpaper.work-master
  variables:
    DOCKER_CLIENT_TIMEOUT: "1800"
    COMPOSE_HTTP_TIMEOUT: "1800"
41
  script:
42
43
44
45
46
47
48
49
    - 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