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

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

Jerome Flesch's avatar
Jerome Flesch committed
7
check:
8
  stage: check
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_dynamic:
Jerome Flesch's avatar
Jerome Flesch committed
19
  stage: deploy
20
  only:
21
    - master@World/OpenPaperwork/openpaper.work
22
23
  tags:
    - openpaper.work
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_static:
Jerome Flesch's avatar
Jerome Flesch committed
38
  stage: deploy
39
40
41
42
43
44
  only:
    - master@World/OpenPaperwork/openpaper.work
  tags:
    - linux
    - volatile
  script:
45
    - sh ./set_apt_proxy.sh
46
    - apt-get install -y -q wget rclone
47
    - apt-get install -y -q python3 python3-virtualenv virtualenv python3-dev
48
    - apt-get install -y -q gettext
49
    - apt-get install -y -q libmariadb-dev
50
    - apt-get install -y -q npm git
51
    - npm install -g bower
52
53
54
    - virtualenv -p python3 venv
    - source venv/bin/activate && make install
    - source venv/bin/activate && ./gen_static_pages.sh static_pages
55
    - ./deliver_static.sh static_pages