.gitlab-ci.yml
branchdev-tf
changeset 408 cf2304af0fab
parent 404 3f249488b3ff
child 411 6093753eed87
equal deleted inserted replaced
407:0037199881fb 408:cf2304af0fab
     1 image: python:3.5
     1 image: python:3.5
     2 
     2 
     3 stages:
     3 stages:
     4     - build
       
     5     - test
     4     - test
       
     5     - dist
       
     6     - quality
     6 
     7 
     7 before_script:
     8 before_script:
     8     - export http_proxy=http://172.17.0.1:3128/
     9     - export http_proxy=http://172.17.0.1:3128/
     9     - export HTTP_PROXY=http://172.17.0.1:3128/
    10     - export HTTP_PROXY=http://172.17.0.1:3128/
    10     - export https_proxy=http://172.17.0.1:3128/
    11     - export https_proxy=http://172.17.0.1:3128/
    11     - export HTTPS_PROXY=http://172.17.0.1:3128/
    12     - export HTTPS_PROXY=http://172.17.0.1:3128/
    12 
    13 
    13 build:
    14 bootstrap:
    14     stage: build
    15     stage: .pre
    15     script:
    16     script:
    16         - python3.5 bootstrap.py --buildout-version=2.12.0
    17         - python3.5 bootstrap.py --buildout-version=2.12.0
    17         - ./bin/buildout
    18         - ./bin/buildout
       
    19 
       
    20 test:
       
    21     stage: test
       
    22     script:
    18         - ./bin/test
    23         - ./bin/test
    19 
    24 
       
    25 dist:
       
    26     stage: dist
       
    27     script:
       
    28         - ./bin/buildout setup setup.py clean --all sdist bdist_egg bdist_wheel
       
    29     artifacts:
       
    30         paths:
       
    31             - ./dist
    20 pylint:
    32 pylint:
    21     stage: test
    33     stage: quality
    22     allow_failure: true
    34     allow_failure: true
    23     script:
    35     script:
    24         - pip install pylint --quiet
    36         - pip install pylint-exit anybadge
    25         - pylint src/pyams_utils/
    37         - mkdir ./pylint
       
    38         - ./bin/pylint src/pyams_utils/ | tee ./pylint/pylint.log || pylint-exit $?
       
    39         - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
       
    40         - anybadge --label=Pylint --file=./pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
       
    41         - echo "Pylint score is $PYLINT_SCORE"
       
    42     artifacts:
       
    43         paths:
       
    44             - ./pylint/
    26 
    45 
    27 quality:
    46 quality:
    28     stage: test
    47     stage: quality
       
    48     allow_failure: true
    29     image: docker:stable
    49     image: docker:stable
    30     variables:
    50     variables:
    31         DOCKER_DRIVER: overlay2
    51         DOCKER_DRIVER: overlay2
    32     allow_failure: true
       
    33     services:
    52     services:
    34         - docker:stable-dind
    53         - docker:stable-dind
    35     script:
    54     script:
    36         - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    55         - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    37         - docker run
    56         - docker run