.gitlab-ci.yml 1.17 KB
Newer Older
Noe Nieto's avatar
Noe Nieto committed
1
image: pureos/amber:latest
2
stages:
Noe Nieto's avatar
Noe Nieto committed
3 4
    - test
    - deb
Noe Nieto's avatar
Noe Nieto committed
5

Noe Nieto's avatar
Noe Nieto committed
6
test:
Noe Nieto's avatar
Noe Nieto committed
7 8 9 10 11 12 13
    variables:
        PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
    cache:
        key: liberty-cache-key
        paths:
            - .cache/pip
            - venv/
Noe Nieto's avatar
Noe Nieto committed
14
    tags:
Noe Nieto's avatar
Noe Nieto committed
15
        - libremone
Noe Nieto's avatar
Noe Nieto committed
16 17
    stage: test
    script:
Noe Nieto's avatar
Noe Nieto committed
18 19 20
        # this configures Django application to use attached postgres database that is run on `postgres` host
        - export DATABASE_URL=postgres://postgres:@postgres:5432/python-test-app
        - apt-get update -qy
Noe Nieto's avatar
Noe Nieto committed
21
        - apt-get install -y python3-dev python-pip pipenv libldap2-dev libpq-dev libsasl2-dev
Noe Nieto's avatar
Noe Nieto committed
22
        - pipenv install --verbose --three --dev --skip-lock
Noe Nieto's avatar
Noe Nieto committed
23
        - pipenv run ./run_tests
Noe Nieto's avatar
Noe Nieto committed
24 25 26 27 28 29 30
        - coverage xml
        - flake8 .
    coverage: "/TOTAL.+ ([0-9]{1,3}%)/"
    artifacts:
        paths:
            - htmlcov
            - docs/_build
31
deb:
Noe Nieto's avatar
Noe Nieto committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45
    tags:
        - libremone
    stage: deb
    script:
        - rbenv global 2.4.0
        - rbenv exec gem install fpm
        - pip3 install --user setuptools
        - make clean
        - make debsource
    artifacts:
        name: "ldh-middleware.deb"
        paths:
                - ./*.deb
        expire_in: 26 weeks
46