Skip to content
.gitlab-ci.yml 889 B
Newer Older
Sergey's avatar
Sergey committed
stages:
admin's avatar
admin committed
    - build
Sergey's avatar
Sergey committed
    - test
admin's avatar
admin committed
    - report
Sergey's avatar
Sergey committed

Sergey's avatar
Sergey committed

admin's avatar
admin committed
build image:
    stage: build
Sergey's avatar
Sergey committed
    before_script:
        - df
        - cat /etc/resolv.conf
        - cat /etc/hosts
Sergey's avatar
Sergey committed

Sergey's avatar
Sergey committed
    script:
admin's avatar
admin committed
        - docker build -t image-test:$CI_COMMIT_SHORT_SHA --no-cache .    
    when: manual

test run:
    stage: test
    needs: 
        - build image
    script:
admin's avatar
admin committed
        - rm -rf /data/allure-results/*
admin's avatar
admin committed
        - docker run --rm
                     --name test 
admin's avatar
admin committed
                     -e MAIN_HOST=$MAIN_HOST
admin's avatar
admin committed
                     -e MAIN_PORT=$MAIN_PORT
admin's avatar
admin committed
                     -v /data/allure-results:/app/allure-results
admin's avatar
admin committed
                     image-test:$CI_COMMIT_SHORT_SHA
admin's avatar
admin committed
    after_script:
        - docker rmi image-test:$CI_COMMIT_SHORT_SHA
    allow_failure: true

create report:
    stage: report
    needs:
        - test run
    script:
admin's avatar
admin committed
        - curl "http://${MAIN_HOST}:${ALLURE_PORT}/generate-report"