詹金斯(Jenkins)的“控制台输出"文件系统中的日志位置 [英] Jenkins "Console Output" log location in filesystem
问题描述
我想在创建此输出的同一作业中作为构建后步骤访问和grep Jenkins控制台输出.用>> log.txt
重定向日志不是解决方案,因为我的构建步骤不支持此操作.
I want to access and grep Jenkins Console Output as a post build step in the same job that creates this output. Redirecting logs with >> log.txt
is not a solution since this is not supported by my build steps.
内部版本:
echo "This is log"
构建后步骤:
grep "is" path/to/console_output
在文件系统中创建的特定日志文件在哪里?
Where is the specific log file created in filesystem?
推荐答案
@Bruno Lavit有一个很好的答案,但是如果您愿意,您可以访问日志并将其作为txt文件从作业的URL下载到您的工作空间:
@Bruno Lavit has a great answer, but if you want you can just access the log and download it as txt file to your workspace from the job's URL:
${BUILD_URL}/consoleText
然后只需将该页面下载到您的${Workspace}
Then it's only a matter of downloading this page to your ${Workspace}
- 您可以使用"
Invoke ANT
"并使用GET目标 - 在Linux上,您可以使用wget将其下载到您的工作空间中
- 等
- You can use "
Invoke ANT
" and use the GET target - On Linux you can use wget to download it to your workspace
- etc.
祝你好运!
文件系统上的实际日志文件不在从服务器上,而是保留在主计算机上.您可以在以下位置找到它:$JENKINS_HOME/jobs/$JOB_NAME/builds/lastSuccessfulBuild/log
The actual log file on the file system is not on the slave, but kept in the Master machine. You can find it under: $JENKINS_HOME/jobs/$JOB_NAME/builds/lastSuccessfulBuild/log
如果您正在寻找另一个版本,只需将lastSuccessfulBuild
替换为您要寻找的版本.
If you're looking for another build just replace lastSuccessfulBuild
with the build you're looking for.
这篇关于詹金斯(Jenkins)的“控制台输出"文件系统中的日志位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!