在Gitlab CI / CD中集成日志文件

时间:2017-06-30 07:35:14

标签: logging error-handling gitlab

如果失败,gitlab管道是否可能显示日志文件(例如Tomcat Log)?

我可以通过SSH连接到服务器并拖尾它。但这要求我必须使用适当的公钥和私钥来设置每个环境。

show log from test:
  stage: fail_handling
  when: on_failure
  script: ssh user@server tail /opt/logs/tomcat.log

一些想法?

1 个答案:

答案 0 :(得分:0)

这就是为什么有文物的原因: https://docs.gitlab.com/ee/user/project/pipelines/job_artifacts.html

常见的情况是,您在失败时提供日志文件,并在成功时提供构建的可执行文件。

相关问题