.gitlab-ci.yml 758 Bytes
Newer Older
Raul Sirel's avatar
Raul Sirel committed
1
image: debian:buster
Raul Sirel's avatar
Raul Sirel committed
2
3

stages:
Raul Sirel's avatar
Raul Sirel committed
4
  - test
Raul Sirel's avatar
Raul Sirel committed
5
  - build
Raul Sirel's avatar
Raul Sirel committed
6
  - build-worker
Raul Sirel's avatar
Raul Sirel committed
7

Raul Sirel's avatar
Raul Sirel committed
8
9
Test:
  before_script:
Raul Sirel's avatar
Raul Sirel committed
10
11
    - apt-get update && apt-get install python3-lxml python3-pip -y
    - pip3 install -r requirements.txt
Raul Sirel's avatar
Raul Sirel committed
12
  stage: test
Raul Sirel's avatar
Raul Sirel committed
13
14
15
  tags:
    - ci-test
  script:
Raul Sirel's avatar
ci fix    
Raul Sirel committed
16
    - python3 -m pytest -v tests
Raul Sirel's avatar
Raul Sirel committed
17
18

Build:
Raul Sirel's avatar
Raul Sirel committed
19
  before_script:
Raul Sirel's avatar
Raul Sirel committed
20
21
    - apt-get update && apt-get install python3-pip -y
    - pip3 install setuptools twine
Raul Sirel's avatar
Raul Sirel committed
22
23
24
25
  stage: build
  tags:
    - ci-test
  script:
Raul Sirel's avatar
Raul Sirel committed
26
    - python3 setup.py sdist
Raul Sirel's avatar
Raul Sirel committed
27
    - twine upload dist/*
Raul Sirel's avatar
Raul Sirel committed
28
29
  only:
    - tags
Raul Sirel's avatar
Raul Sirel committed
30
31
32
33
34
35
36

BuildWorker:
  stage: build-worker
  tags:
    - docker
  script:
    - docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD docker.texta.ee
Raul Sirel's avatar
Raul Sirel committed
37
    - sh ./worker/docker/build_and_push.sh
Raul Sirel's avatar
Raul Sirel committed
38
39
40
    - docker system prune --volumes -f
  only:
    - tags