.gitlab-ci.yml
changeset 424 5028ff294931
parent 416 0ef63dbfecd1
child 417 e7e36ec88a06
child 425 aeea1428f782
equal deleted inserted replaced
423:d69d9c919448 424:5028ff294931
     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
       
     7 
       
     8 cache:
       
     9     paths:
       
    10         - bin/
       
    11         - eggs/
       
    12         - parts/
     6 
    13 
     7 before_script:
    14 before_script:
     8     - export http_proxy=http://172.17.0.1:3128/
    15     - export http_proxy=http://172.17.0.1:3128/
     9     - export HTTP_PROXY=http://172.17.0.1:3128/
    16     - export HTTP_PROXY=http://172.17.0.1:3128/
    10     - export https_proxy=http://172.17.0.1:3128/
    17     - export https_proxy=http://172.17.0.1:3128/
    11     - export HTTPS_PROXY=http://172.17.0.1:3128/
    18     - export HTTPS_PROXY=http://172.17.0.1:3128/
    12 
    19 
    13 build:
    20 bootstrap:
    14     stage: build
    21     stage: .pre
    15     script:
    22     script:
    16         - python3.5 bootstrap.py --buildout-version=2.12.0
    23         - python3.5 bootstrap.py --buildout-version=2.12.0
    17         - ./bin/buildout
    24         - ./bin/buildout
       
    25 
       
    26 test:
       
    27     stage: test
       
    28     script:
       
    29         - pwd
       
    30         - ls -l
       
    31         - head ./bin/test
    18         - ./bin/test
    32         - ./bin/test
    19 
    33 
       
    34 dist:
       
    35     stage: dist
       
    36     script:
       
    37         - ./bin/buildout setup setup.py clean --all sdist bdist_egg bdist_wheel
       
    38     artifacts:
       
    39         paths:
       
    40             - ./dist
       
    41 
    20 pylint:
    42 pylint:
    21     stage: test
    43     stage: quality
    22     allow_failure: true
    44     allow_failure: true
    23     script:
    45     script:
    24         - pip install pylint --quiet
    46         - pip install pylint-exit anybadge
    25         - pylint src/pyams_utils/
    47         - mkdir ./pylint
       
    48         - ./bin/pylint src/pyams_utils/ | tee ./pylint/pylint.log || pylint-exit $?
       
    49         - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log)
       
    50         - anybadge --label=Pylint --file=./pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green
       
    51         - echo "Pylint score is $PYLINT_SCORE"
       
    52     artifacts:
       
    53         paths:
       
    54             - ./pylint/
    26 
    55 
    27 quality:
    56 quality:
    28     stage: test
    57     stage: quality
       
    58     allow_failure: true
    29     image: docker:stable
    59     image: docker:stable
    30     variables:
    60     variables:
    31         DOCKER_DRIVER: overlay2
    61         DOCKER_DRIVER: overlay2
    32     allow_failure: true
       
    33     services:
    62     services:
    34         - docker:stable-dind
    63         - docker:stable-dind
    35     script:
    64     script:
    36         - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    65         - export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
    37         - docker run
    66         - docker run