GitLab CI 中的组日志

问题描述 投票:0回答:1

GitLab CI 中是否存在日志分组?

GitHub Actions 使用

::group::
::endgroup::
将日志封装成可折叠的段,这使得日志审核更加简单。

::group::{section title}
{logs that should be grouped}
::endgroup::
gitlab-ci
1个回答
0
投票

基于 https://docs.gitlab.com/ee/ci/jobs/#custom-collapsible-sections 解决方案是使用:

- echo -e "\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\r\e[0KHeader of the 1st collapsible section"
- echo 'this line should be hidden when collapsed'
- echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
© www.soinside.com 2019 - 2024. All rights reserved.