我已经创建了一个在$CI_PROJECT_DIR上执行ansible-lint的管道。问题是,与在本地机器上运行相比,UI中没有显示完整的输出。
您可以注意到两者在输出上的差异。
下面是我的本地机器的输出(Ubuntu安装了ansible-lint )
**ansible-lint create-dir.yaml -v**
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: create-dir.yaml
INFO Executing syntax check on create-dir.yaml (0.31s)
WARNING Listing 1 violation(s) that are fatal
syntax-check: 'file' is not a valid attribute for a Play
create-dir.yaml:4:3 [WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
ERROR! 'file' is not a valid attribute for a Play
The error appears to be in '/tmp/create-dir.yaml': line 4, column 3, but may be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
---
- name: Create a directory if it does not exist
^ here
Finished with 1 failure(s), 0 warning(s) on 1 files.以下是Gitlab CI的输出:
$ find ./ -not \( -name "*.ansible-lint" -o -name ".gitlab-ci.yml" \) \( -name "*yml" -o -name "*yaml" \) | xargs ansible-lint -v
WARNING Overriding detected file kind 'yaml' with 'playbook' for given positional argument: ./ansible/create-dir.yaml
INFO Executing syntax check on ansible/create-dir.yaml (0.39s)
Cleaning up project directory and file based variables 00:01
Job succeeded我想知道为什么输出有差异,以及如何在Gitlab CI上打印完整的消息。
发布于 2022-01-24 07:37:55
GitLab CI/CD中的作业日志长度有限。它是出于操作上的原因而设计的,因为作业可以产生任意的输出,因此一个人可以错误地或有目的地输出甚至是千兆字节或兆字节的文本。
但是,如果在输出中向上滚动,就有能力通过按下“完整的原始数据”来查看完整的日志。

https://stackoverflow.com/questions/70828050
复制相似问题