简体   繁体   中英

How to get detailed error information when gitlab-ci fails

Gitlab version is 13.6.6 Gitlab-runner version is 11.2.0

my .gitlab-ci.yml :

image: "python:3.7"

before_script:
  - pip install flake8

flake8:
  stage: test
  script:
    - flake8 -max-line-length=79
  tags:
    - test

The only information obtained from Pipelines is script failure and the output of failed job is No job log . How can I get more detailed error output?

Using artifacts can help you.
image: "python:3.7"

before_script:
  - pip install flake8

flake8:
  stage: test
  script:
    - flake8 -max-line-length=79
    - cd path/to
  tags:
    - test
  artifacts:
    when: on_failure
    paths:
      - path/to/test.log
      
The log file can be downloaded via the web interface.

Note:- Using when: on_failure will ensure that test.log will only be collected if the build fails, saving disk space on successful builds.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM