.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
13
14
15
16
  tags:
    - linux
    - volatile
  script:
    - apt-get update
    - 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
24
  tags:
    - openpaper.work
  script:
25
26
27
28
    # this gitlab-runner is not running as root
    # - apt-get update
    # - apt-get install -y -q python3 python3-virtualenv
    # - apt-get install -y -q libmariadb-dev
29
    - cd /var/www/openpaper.work && git pull
Jerome Flesch's avatar
Jerome Flesch committed
30
    - cd /var/www/openpaper.work && source venv/bin/activate && make install
31
    - sudo /etc/reload_apache.sh
32
33

deploy_static:
Jerome Flesch's avatar
Jerome Flesch committed
34
  stage: deploy
35
36
37
38
39
40
41
42
  only:
    - master@World/OpenPaperwork/openpaper.work
  tags:
    - linux
    - volatile
  script:
    - apt-get update
    - apt-get install -y -q wget rclone
43
    - apt-get install -y -q python3 python3-virtualenv virtualenv python3-dev
44
    - apt-get install -y -q gettext
45
    - apt-get install -y -q libmariadb-dev
46
    - apt-get install -y -q npm git
47
    - npm install -g bower
48
    - cp openpaper/template_local_settings.py openpaper/local_settings.py
49
50
51
    - virtualenv -p python3 venv
    - source venv/bin/activate && make install
    - source venv/bin/activate && ./gen_static_pages.sh static_pages
52
    - ./deliver_static.sh static_pages